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
Show file tree
Hide file tree
Changes from all 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
34 changes: 34 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Neccesary checkmarks:

[] All Tests are Passing

[] The code will run locally

Type of change

[] New feature
[] Bug Fix
[] Refactor

Implements/Fixes:

description closes #

Check the correct boxes

[] This broke nothing
[] This broke some stuff
[] This broke everything

Testing Changes

[] No Tests have been changed
[] Some Tests have been changed
[] All of the Tests have been changed(Please describe what in the world happened)

Checklist:

[] My code has no unused/commented out code
[] I have reviewed my code
[] I have commented my code, particularly in hard-to-understand areas
[] I have fully tested my code
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
/tmp/*
!/log/.keep
!/tmp/.keep

/node_modules
/yarn-error.log

# Ignore test coverage
/coverage/*

# sensative data
.env
# Ignore application configuration
/config/application.yml
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.2
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
language: ruby
rbenv:
- 2.5.3
- 2.7.2
addons:
postgresql: 9.6
script:
- bundle exec rails db:{create,migrate} RAILS_ENV=test
- bundle exec rspec
deploy:
provider: heroku

api_key:
app:
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: viewing-party-turing
run: rails db:migrate
12 changes: 11 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ end

ruby '2.7.2'

gem 'figaro'

gem 'dotenv-rails'
gem 'rails', '5.2.5'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 3.7'
Expand All @@ -15,24 +18,31 @@ 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'
gem 'shoulda-matchers'
gem 'database_cleaner'
gem 'webmock'
gem 'vcr'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
75 changes: 75 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -67,11 +70,28 @@ GEM
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.8)
crack (0.4.5)
rexml
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)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
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)
Expand All @@ -84,6 +104,11 @@ 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)
figaro (1.2.0)
thor (>= 0.14.0, < 2)
gh (0.18.0)
activesupport (~> 5.0)
addressable (~> 2.4)
Expand All @@ -94,15 +119,21 @@ GEM
net-http-pipeline
globalid (0.4.2)
activesupport (>= 4.2.0)
hashdiff (1.0.1)
highline (2.0.3)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
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)
Expand All @@ -118,27 +149,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)
Expand Down Expand Up @@ -219,12 +266,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)
Expand All @@ -234,6 +285,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)
Expand All @@ -245,29 +297,49 @@ 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)
vcr (6.0.0)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webmock (3.13.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
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
dotenv-rails
factory_bot_rails
figaro
jbuilder (~> 2.5)
jwt
launchy
listen (>= 3.0.5, < 3.2)
pg (>= 0.18, < 2.0)
Expand All @@ -277,11 +349,14 @@ DEPENDENCIES
rspec-rails
rubocop-rails
sass-rails (~> 5.0)
shoulda-matchers
simplecov
travis
tzinfo-data
uglifier (>= 1.3.0)
vcr
web-console (>= 3.3.0)
webmock

RUBY VERSION
ruby 2.7.2p137
Expand Down
7 changes: 7 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception

helper_method :current_user

def current_user
@current_user ||= User.find(cookies.encrypted[:user_id]) if cookies[:user_id]
end

end
7 changes: 7 additions & 0 deletions app/controllers/discover_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class DiscoverController < ApplicationController

def index
@top_movies = ImdbService.top_movies
end

end
10 changes: 10 additions & 0 deletions app/controllers/movies_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class MoviesController < ApplicationController

def index
@movie_search = ImdbService.top_movies_search(params[:movie_title])
end

def show
@title = params[:title]
end
end
24 changes: 24 additions & 0 deletions app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class SessionsController < ApplicationController

def new

end

def create
found_user = User.find_by(email: params[:email])
if found_user && found_user.authenticate(params[:password])
cookies.encrypted[:user_id] = found_user.id
flash[:success] = "Welcome, #{found_user.email}!"
redirect_to "/dashboard"
else
flash[:error] = "Your username or password are incorrect"
redirect_to "/login"
end
end

def destroy
cookies.delete :user_id
redirect_to '/'
end

end
Loading