Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registration sad path #126

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Changes from 9 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d6af67e
Create pull_request_template.md
LawrenceWhalen Jul 5, 2021
62f0b55
Update pull_request_template.md
LawrenceWhalen Jul 5, 2021
3823fa2
Add refactor option to change type
LawrenceWhalen Jul 5, 2021
709d03f
Add heroku data to travis CI
LawrenceWhalen Jul 5, 2021
b72daab
Start Travis
LawrenceWhalen Jul 6, 2021
85e39b8
Update .travis.yml
LawrenceWhalen Jul 6, 2021
a24541d
Update pull_request_template.md
LawrenceWhalen Jul 6, 2021
4e74e33
Merge pull request #1 from LawrenceWhalen/Whalen-pull-request-template
LawrenceWhalen Jul 6, 2021
d57349f
Create model tests and models
LawrenceWhalen Jul 6, 2021
1b42293
Create and test self reference for user
LawrenceWhalen Jul 6, 2021
5a03b14
Early push for emergency
LawrenceWhalen Jul 6, 2021
8da2503
fix migration of atendee
Aphilosopher30 Jul 6, 2021
8d9ff53
make tests for models relationships
Aphilosopher30 Jul 6, 2021
a1e9724
Merge branch 'main' of github.com:LawrenceWhalen/viewing_party
LawrenceWhalen Jul 7, 2021
df83cf3
Merge branch 'main' into model-test
LawrenceWhalen Jul 7, 2021
fb39cbf
Update gemfile ruby version
LawrenceWhalen Jul 7, 2021
bb766fe
Create and test the user creation process
LawrenceWhalen Jul 7, 2021
6809c32
Merge branch 'main' into creation-setup
LawrenceWhalen Jul 7, 2021
0860123
Merge pull request #22 from LawrenceWhalen/model-test
Aphilosopher30 Jul 7, 2021
dbbef03
Update user_spec.rb
LawrenceWhalen Jul 7, 2021
6a5d5e6
Merge branch 'main' into creation-setup
LawrenceWhalen Jul 7, 2021
bddb74d
Merge branch 'main' of github.com:LawrenceWhalen/viewing_party
LawrenceWhalen Jul 7, 2021
eaff82e
Delete 20210707213534_create_attendee.rb
LawrenceWhalen Jul 7, 2021
0ca8ad5
Merge pull request #23 from LawrenceWhalen/creation-setup
Aphilosopher30 Jul 7, 2021
7ff5771
Merge branch 'main' of github.com:LawrenceWhalen/viewing_party
LawrenceWhalen Jul 7, 2021
c07ddb5
Test and create loggin in and out
LawrenceWhalen Jul 7, 2021
7789ccc
Merge pull request #24 from LawrenceWhalen/login-setup
Aphilosopher30 Jul 8, 2021
24e3531
sad paths for registration
Aphilosopher30 Jul 8, 2021
ca48956
Swap from sessions to cookies and show path to dashboard
LawrenceWhalen Jul 8, 2021
2305e40
upgrade ruby version
Aphilosopher30 Jul 8, 2021
0ccc36d
preperation for murge to main
Aphilosopher30 Jul 8, 2021
b35b3cc
add tests to check that we are adding what we want to the data base
Aphilosopher30 Jul 8, 2021
36ba12a
Setup webmock/vcr and write tests for api
LawrenceWhalen Jul 8, 2021
718af8e
add password confirmation
Aphilosopher30 Jul 8, 2021
120fae6
validate features
Aphilosopher30 Jul 8, 2021
13e8e91
Create test for and pass movie index tests
LawrenceWhalen Jul 8, 2021
4183917
Remove sensative data
LawrenceWhalen Jul 8, 2021
a825363
Merge pull request #26 from LawrenceWhalen/movies-setup
Aphilosopher30 Jul 9, 2021
4152ac4
merge changes into branch
Aphilosopher30 Jul 9, 2021
b823a73
validation tests fix
Aphilosopher30 Jul 9, 2021
d100dcd
Sensitive data
LawrenceWhalen Jul 9, 2021
66fdf56
Sensitive data
LawrenceWhalen Jul 9, 2021
a116193
Sensitive data
LawrenceWhalen Jul 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .byebug_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exit
!!!
n
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@ script:
- bundle exec rspec
deploy:
provider: heroku
api_key: e938df06-1f27-48a1-b9c1-72131cda2003

api_key:
secure: LUNR1EsF3qm7rOxPk8pqu9lltrphHB54ViLuuYu6nRnpYa4ef/9WDBklqzAyR2sQynDoUnqNufkF2HhJjP0BWfH/c8fDYhD7D37+9LrRo0ugwOjOAbQkrm4x36DxKbXHHDbiThiP5is+VMw3iQZu5DOPIup+uF1RXU0db7/XsfIlXtuCiBKqKTvhZYgDZvRL5GxxP3yu7YZaRf2un4a+L23iWPUWZi+CI4Aq6gxuTCkOfmGTSsFEaVdgDvNQU0EBag0wxkrHIJRREcngDrJPMOxwo0zP0Ta28k19QplFADgV/dBi3/E/scPQ+B0b04kWpGVymgaZo5wv4X86vpB4bYoiyiVtDHj4qr4ndHiMw01rprPkzVtj02HX1r7ko972NB3MXykyGzC3PZttcb0p5z5Jbm+2MhmVrBBegIXG+uSABkRxSq9KHvUc1jOzQCU6lfPj0BcBZFJB/ku7m6i7P2CAlOuvCY5F+NVYnD48mK7hepf9hKP+XSzrxRBii229oD5S+cW6EUqwOzN/mofNWxKWNHglJao+/BNqVxsXLjZRgUFH2sZQzstuzTegwjA25NobGxmq8FwRHf6kP93uif9lSd7fJjETqQ2vr7ntAJAf6bgyA+1x19Y9ccfE8JV1yhPSOq+6zh6lA4Vdr4x7/Qto6efO2+pOEkn3QJMSyng=

app: https://viewing-party-turing.herokuapp.com/
run: rails db:migrate
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -15,24 +15,29 @@ gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'bootsnap'
gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.7'
gem 'jwt'

group :development, :test do
gem 'pry'
gem 'travis'
gem 'byebug'
end

group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'rubocop-rails'
gem 'travis'
end

group :test do
gem 'rspec-rails'
gem 'capybara'
gem 'launchy'
gem 'simplecov'
gem 'factory_bot_rails', '~> 4.0'
gem 'shoulda-matchers'
gem 'database_cleaner'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
59 changes: 58 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -46,10 +46,13 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
arel (9.0.0)
ast (2.4.2)
bcrypt (3.1.16)
bcrypt (3.1.16-java)
bindex (0.8.1)
bootsnap (1.7.5)
msgpack (~> 1.0)
builder (3.2.4)
byebug (11.1.3)
capybara (3.35.3)
addressable
mini_mime (>= 0.1.3)
@@ -68,10 +71,21 @@ GEM
coffee-script-source (1.12.2)
concurrent-ruby (1.1.8)
crass (1.0.6)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
database_cleaner-active_record (2.0.1)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
diff-lcs (1.4.4)
docile (1.3.5)
erubi (1.10.0)
execjs (2.8.0)
factory_bot (4.11.1)
activesupport (>= 3.0.0)
factory_bot_rails (4.11.1)
factory_bot (~> 4.11.1)
railties (>= 3.0.0)
faraday (1.4.1)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
@@ -84,6 +98,9 @@ GEM
faraday_middleware (1.0.0)
faraday (~> 1.0)
ffi (1.15.0)
ffi (1.15.0-java)
ffi (1.15.0-x64-mingw32)
ffi (1.15.0-x86-mingw32)
gh (0.18.0)
activesupport (~> 5.0)
addressable (~> 2.4)
@@ -100,9 +117,14 @@ GEM
jbuilder (2.11.2)
activesupport (>= 5.0.0)
json (2.5.1)
json (2.5.1-java)
json_pure (2.5.1)
jwt (2.2.3)
launchy (2.4.3)
addressable (~> 2.3)
launchy (2.4.3-java)
addressable (~> 2.3)
spoon (~> 0.0.1)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
@@ -118,27 +140,43 @@ GEM
mini_portile2 (2.5.1)
minitest (5.14.4)
msgpack (1.4.2)
msgpack (1.4.2-java)
multi_json (1.15.0)
multipart-post (2.1.1)
net-http-persistent (2.9.4)
net-http-pipeline (1.0.1)
nio4r (2.5.7)
nio4r (2.5.7-java)
nokogiri (1.11.3)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
nokogiri (1.11.3-java)
racc (~> 1.4)
nokogiri (1.11.3-x64-mingw32)
racc (~> 1.4)
nokogiri (1.11.3-x86-mingw32)
racc (~> 1.4)
parallel (1.20.1)
parser (3.0.1.1)
ast (~> 2.4.1)
pg (1.2.3)
pg (1.2.3-x64-mingw32)
pg (1.2.3-x86-mingw32)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry (0.14.1-java)
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
public_suffix (4.0.6)
puma (3.12.6)
puma (3.12.6-java)
pusher-client (0.6.2)
json
websocket (~> 1.0)
racc (1.5.2)
racc (1.5.2-java)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
@@ -219,12 +257,16 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
spoon (0.0.6)
ffi
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@@ -234,6 +276,7 @@ GEM
sprockets (>= 3.0.0)
thor (1.1.0)
thread_safe (0.3.6)
thread_safe (0.3.6-java)
tilt (2.0.10)
travis (1.10.0)
faraday (~> 1.0)
@@ -245,6 +288,8 @@ GEM
pusher-client (~> 0.4)
tzinfo (1.2.9)
thread_safe (~> 0.1)
tzinfo-data (1.2021.1)
tzinfo (>= 1.0.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.0.0)
@@ -256,18 +301,29 @@ GEM
websocket (1.2.9)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-driver (0.7.3-java)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
java
ruby
x64-mingw32
x86-mingw32
x86-mswin32

DEPENDENCIES
bcrypt (~> 3.1.7)
bootsnap
byebug
capybara
coffee-rails (~> 4.2)
database_cleaner
factory_bot_rails (~> 4.0)
jbuilder (~> 2.5)
jwt
launchy
listen (>= 3.0.5, < 3.2)
pg (>= 0.18, < 2.0)
@@ -277,14 +333,15 @@ DEPENDENCIES
rspec-rails
rubocop-rails
sass-rails (~> 5.0)
shoulda-matchers
simplecov
travis
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)

RUBY VERSION
ruby 2.7.2p137
ruby 2.5.3p105

BUNDLED WITH
2.1.4
9 changes: 9 additions & 0 deletions app/models/attendee.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Attendee < ApplicationRecord

belongs_to :user
belongs_to :movie_party

# validates_presence_of :user, :viewing_party
# validates :user_id, uniqueness: {scope: :viewing_party_id}

end
9 changes: 9 additions & 0 deletions app/models/friend.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Friend < ApplicationRecord

belongs_to :friender, class_name: 'User'
belongs_to :friendee, class_name: 'User'

# validates_presence_of :friender, :friendee
# validates :friender, uniqueness: {scope: :friendee_id}

end
9 changes: 9 additions & 0 deletions app/models/movie_party.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class MovieParty < ApplicationRecord

has_many :attendees, dependent: :destroy
has_many :users, through: :attendees
# belongs_to :user

# validates_presence_of :user, :movie_title, :date_time

end
17 changes: 17 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class User < ApplicationRecord

has_secure_password

has_many :friends, foreign_key: :friendee_id, dependent: :destroy
has_many :friendees, through: :friends
has_many :friend_alias, class_name: 'Friend', foreign_key: :friender_id, dependent: :destroy
has_many :frienders, through: :friend_alias

has_many :attendees, dependent: :destroy
has_many :movie_parties, through: :attendees
has_many :movie_parties, dependent: :destroy

# validates :email, uniqueness: true, presence: true
# validates_presence_of :password_digest, require: true

end
10 changes: 10 additions & 0 deletions db/migrate/20210705225035_create_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateUser < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
t.string :email
t.string :password_digest

t.timestamps
end
end
end
10 changes: 10 additions & 0 deletions db/migrate/20210705230003_create_friend.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateFriend < ActiveRecord::Migration[5.2]
def change
create_table :friends do |t|
t.integer :friender_id, foreign_key: true
t.integer :friendee_id, foreign_key: true

t.timestamps
end
end
end
9 changes: 9 additions & 0 deletions db/migrate/20210706220613_create_movie_party.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CreateMovieParty < ActiveRecord::Migration[5.2]
def change
create_table :movie_parties do |t|
t.references :user, foreign_key: true
t.string :movie_title
t.datetime :date_time
end
end
end
10 changes: 10 additions & 0 deletions db/migrate/20210706222037_create_attendees.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateAttendees < ActiveRecord::Migration[5.2]
def change
create_table :attendees do |t|
t.references :user, foreign_key: true
t.references :movie_party, foreign_key: true

t.timestamps
end
end
end
51 changes: 51 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_07_06_222037) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "attendees", force: :cascade do |t|
t.bigint "user_id"
t.bigint "movie_party_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["movie_party_id"], name: "index_attendees_on_movie_party_id"
t.index ["user_id"], name: "index_attendees_on_user_id"
end

create_table "friends", force: :cascade do |t|
t.integer "friender_id"
t.integer "friendee_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "movie_parties", force: :cascade do |t|
t.bigint "user_id"
t.string "movie_title"
t.datetime "date_time"
t.index ["user_id"], name: "index_movie_parties_on_user_id"
end

create_table "users", force: :cascade do |t|
t.string "email"
t.string "password_digest"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

add_foreign_key "attendees", "movie_parties"
add_foreign_key "attendees", "users"
add_foreign_key "movie_parties", "users"
end
6 changes: 6 additions & 0 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FactoryBot.define do
factory :user do
email { '[email protected]' }
password { 'foobar' }
end
end
10 changes: 10 additions & 0 deletions spec/models/attendee_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'rails_helper'

RSpec.describe Attendee, type: :model do

describe 'relationships' do
it { should belong_to(:user) }
it { should belong_to(:movie_party) }
end

end
10 changes: 10 additions & 0 deletions spec/models/friend_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'rails_helper'

RSpec.describe Friend, type: :model do

describe 'relationships' do
it { should belong_to :friendee }
it { should belong_to :friender }
end

end
10 changes: 10 additions & 0 deletions spec/models/movie_party_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'rails_helper'

RSpec.describe MovieParty, type: :model do

describe 'relationships' do
it { should have_many(:attendees) }
it { should have_many(:users) }
end

end
21 changes: 21 additions & 0 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'rails_helper'

RSpec.describe User, type: :model do

describe 'relationships' do
it { should have_many(:friends).dependent(:destroy) }
it { should have_many(:friendees).class_name('User') }
it { should have_many(:frienders).class_name('User') }

it { should have_many(:attendees).dependent(:destroy) }
# it { should have_many(:movie_parties) }
it { should have_many(:movie_parties).dependent(:destroy)}
end

# describe 'validations' do
# it { should validate_presence_of(:email) }
# it { should validate_uniqueness_of(:email) }
# it { should validate_presence_of(:password_digest) }
# end

end
7 changes: 7 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -61,4 +61,11 @@
config.filter_rails_from_backtrace!
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")

Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end
end