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

Vcr #131

Open
wants to merge 136 commits into
base: main
Choose a base branch
from
Open

Vcr #131

Changes from 1 commit
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
3de11a6
Create pull_request_template.md
Caleb1991 Jul 5, 2021
7bcf0b2
Merge pull request #20 from Caleb1991/Caleb1991-patch-1
JoannaCoPo Jul 6, 2021
d43d46d
Add rubocop to gemfile
Caleb1991 Jul 6, 2021
5f0a693
Delete gemfile.lock
Caleb1991 Jul 6, 2021
683b22e
bundle install
Caleb1991 Jul 6, 2021
a7a79d4
Update Travid yml file
Caleb1991 Jul 6, 2021
bd151d7
Merge pull request #22 from Caleb1991/gemfile_update_2
JoannaCoPo Jul 6, 2021
0280a59
Add schema diagram
JoannaCoPo Jul 6, 2021
3c70f47
Fix file path
JoannaCoPo Jul 6, 2021
fcbc63e
Fix file path
JoannaCoPo Jul 6, 2021
73e6a78
Update README.md
JoannaCoPo Jul 6, 2021
667cbac
Update README.md
JoannaCoPo Jul 6, 2021
0075cfe
Merge pull request #23 from Caleb1991/schema
Caleb1991 Jul 6, 2021
0aa0447
Create user table
Caleb1991 Jul 6, 2021
cbce4b0
Merge pull request #24 from Caleb1991/registration_page
JoannaCoPo Jul 6, 2021
fd633c3
Change ruby v to 2.7.2
JoannaCoPo Jul 6, 2021
8acec1c
TDD welcome page
JoannaCoPo Jul 6, 2021
c98ba4b
Add route for welcome index
JoannaCoPo Jul 6, 2021
d5e9751
Create welcome controller
JoannaCoPo Jul 6, 2021
438d857
Add shoulda matchers
JoannaCoPo Jul 6, 2021
32a8176
Add model test for user
JoannaCoPo Jul 6, 2021
ae7d4cd
Add validations and has_secure_password to User
JoannaCoPo Jul 6, 2021
b7eb363
Add view functionality
JoannaCoPo Jul 6, 2021
ce21baa
Create functionality for registration page, and test for edge cases o…
Caleb1991 Jul 7, 2021
d6e7bab
Correct Rubocop warnings
Caleb1991 Jul 7, 2021
18a47f4
Merge pull request #25 from Caleb1991/registration_form
JoannaCoPo Jul 7, 2021
1c78556
Create migrations for User Friendships, Viewing Parties, and Attendees
Caleb1991 Jul 7, 2021
95fbfaf
Merge pull request #26 from Caleb1991/migrations
JoannaCoPo Jul 7, 2021
d6b78b6
Save work
JoannaCoPo Jul 8, 2021
1d7ce00
Define current_user helper in application controller
JoannaCoPo Jul 8, 2021
56910a7
Add user status functionality
JoannaCoPo Jul 8, 2021
56f35c5
Add login and registration paths
JoannaCoPo Jul 8, 2021
4c20fc5
Create login sesssions controller with create action
JoannaCoPo Jul 8, 2021
87eb974
Add user controller with empty create action
JoannaCoPo Jul 8, 2021
5eac100
Create new view for sessions
JoannaCoPo Jul 8, 2021
c1939d6
Clean up test file
JoannaCoPo Jul 8, 2021
24bec77
Merge branch 'main' into welcome_page
Caleb1991 Jul 8, 2021
c3fb36f
Merge pull request #27 from Caleb1991/welcome_page
Caleb1991 Jul 8, 2021
807890c
Remove second instance of shoulda-matchers
Caleb1991 Jul 8, 2021
6c3f87a
Change button_to to link_to
JoannaCoPo Jul 8, 2021
07fee50
Change redirect route to root path
JoannaCoPo Jul 8, 2021
987b8bd
Create dashboard template
Caleb1991 Jul 8, 2021
ea78669
Add login form
JoannaCoPo Jul 8, 2021
75352e0
Change registration button to link
JoannaCoPo Jul 8, 2021
cce341b
Fix assertions
JoannaCoPo Jul 9, 2021
d2eccc2
Run migrations for remaining tables
JoannaCoPo Jul 9, 2021
bc7c400
Fix all relevent button assertions to link
JoannaCoPo Jul 9, 2021
42ad682
Test correct login credentials
JoannaCoPo Jul 9, 2021
0f45ab3
Add action and route for logout
JoannaCoPo Jul 9, 2021
0ec22ff
Test for invalid login attempt
JoannaCoPo Jul 9, 2021
c5b1bcd
Merge pull request #28 from Caleb1991/dashboard
JoannaCoPo Jul 9, 2021
7fb2b49
Merge pull request #29 from Caleb1991/welcome_page
Caleb1991 Jul 9, 2021
74e3032
Models with relationships
JoannaCoPo Jul 10, 2021
53641a7
Create model test for attendee
JoannaCoPo Jul 10, 2021
cbbdd7e
Add relationships for ViewingParty
JoannaCoPo Jul 10, 2021
199201d
Create model test for ViewingParty
JoannaCoPo Jul 10, 2021
36949e7
Create UserFriendships functionality as well as tests. In addition ad…
Caleb1991 Jul 10, 2021
a2ce772
Merge pull request #30 from Caleb1991/user_friendships
JoannaCoPo Jul 10, 2021
ddae3fb
Add tests for viewing party sections
JoannaCoPo Jul 10, 2021
a0db7a0
Add movie show page path
JoannaCoPo Jul 10, 2021
73c353e
Merge
JoannaCoPo Jul 10, 2021
dd92846
Merge
JoannaCoPo Jul 10, 2021
808e628
Edit all revleant models and tests to change ViewingParty to Party
JoannaCoPo Jul 10, 2021
0261082
Active record for user invites
JoannaCoPo Jul 11, 2021
1fece75
Work on functionality for parties intbvited to
JoannaCoPo Jul 11, 2021
e710b14
Comment out show action; revisit
JoannaCoPo Jul 11, 2021
d12dc68
Remove white space
JoannaCoPo Jul 11, 2021
862bbaf
Add movie_title attribute for viewing parties
JoannaCoPo Jul 11, 2021
37015b4
Create tests for viewing party sections
JoannaCoPo Jul 11, 2021
80aafc9
Add functionality for viewing party sections
JoannaCoPo Jul 11, 2021
aa56fce
Merge pull request #31 from Caleb1991/viewing_parties
Caleb1991 Jul 12, 2021
35cd045
Address some rubocop violations
Caleb1991 Jul 12, 2021
3d1fe20
Merge pull request #32 from Caleb1991/rubocop
JoannaCoPo Jul 12, 2021
a77a4be
Add figaro gem, update travis yml file
Caleb1991 Jul 13, 2021
e4d08b4
Update Travis
Caleb1991 Jul 13, 2021
d7fb592
Update Travis again
Caleb1991 Jul 13, 2021
6f000e0
Add bundle install and bundle update to Travis script
Caleb1991 Jul 13, 2021
9166018
Remove bundle update from Travis
Caleb1991 Jul 13, 2021
739b05d
Update README.md
Caleb1991 Jul 13, 2021
7d9f725
Update usernames to include link to given user's GitHub
Caleb1991 Jul 13, 2021
63927b7
Layout template for API consumption
Caleb1991 Jul 13, 2021
25585cd
Merge pull request #35 from Caleb1991/API
JoannaCoPo Jul 13, 2021
3232cb7
Set up Faraday connection and JSON parsing
JoannaCoPo Jul 13, 2021
92ca12f
General setup for api consumption and testing
JoannaCoPo Jul 13, 2021
aa2f02d
Install testing gems
JoannaCoPo Jul 13, 2021
757b902
Prepare stubs for api testing
JoannaCoPo Jul 13, 2021
29d89ea
Add movie search and plan top rated
JoannaCoPo Jul 13, 2021
168699c
Bring in three endpoints for API for movie details page
Caleb1991 Jul 13, 2021
962add5
Merge pull request #36 from Caleb1991/movie_details
JoannaCoPo Jul 13, 2021
2a47b91
Merge partner progress
JoannaCoPo Jul 13, 2021
4a22eb2
Slight refactor on Movie poros, as well as APIServices
Caleb1991 Jul 13, 2021
fe2b35a
adds api key to gitignore
JoannaCoPo Jul 13, 2021
1ee6b87
Update gitignore
JoannaCoPo Jul 13, 2021
313c25b
Comment out gem temporarily
JoannaCoPo Jul 13, 2021
7f710c6
Temp tests
JoannaCoPo Jul 13, 2021
22ad0fe
migrate movie search helpers to movie_facade
JoannaCoPo Jul 13, 2021
2c65fb0
Add create_movie_objects helper
JoannaCoPo Jul 13, 2021
45c03fa
Create poros directt with film_standard class
JoannaCoPo Jul 13, 2021
69255f0
Add search params to search_by_movie
JoannaCoPo Jul 13, 2021
3ee8329
Add index routes for discover and movies
JoannaCoPo Jul 13, 2021
e5c53db
Create initial test for discover index page
JoannaCoPo Jul 13, 2021
b3b9035
Add movies spec directory
JoannaCoPo Jul 13, 2021
f2722e5
Add index view for discover page
JoannaCoPo Jul 13, 2021
712749e
Create movies index page
JoannaCoPo Jul 14, 2021
6b279a6
Create discover controller
JoannaCoPo Jul 14, 2021
b791135
Fix typo in forms
JoannaCoPo Jul 14, 2021
41ba7f1
Fix test typos; test passing
JoannaCoPo Jul 14, 2021
f98cfad
Improve naming
JoannaCoPo Jul 14, 2021
b66726d
Merge pull request #37 from Caleb1991/movie_details_refactor
JoannaCoPo Jul 14, 2021
dc1e6a6
Merge refactor
JoannaCoPo Jul 14, 2021
2cf8c01
Fix instance variable
JoannaCoPo Jul 14, 2021
cb87b24
Fix routing for sessions login
JoannaCoPo Jul 14, 2021
13360e5
Uncomment out show action
JoannaCoPo Jul 14, 2021
23301ca
Fix syntax issue
JoannaCoPo Jul 14, 2021
40dcd3d
Fix order syntax in top_rated
JoannaCoPo Jul 14, 2021
c38e1ef
Fix typo in index action
JoannaCoPo Jul 14, 2021
9a3fedb
Update text field specification
JoannaCoPo Jul 14, 2021
2ce6b5d
Add spacing
JoannaCoPo Jul 14, 2021
a740cfc
Add line break
JoannaCoPo Jul 14, 2021
cd896ac
Create movies index spec
JoannaCoPo Jul 14, 2021
f35872e
Debug tests
JoannaCoPo Jul 14, 2021
4668426
Merge pull request #38 from Caleb1991/api_movie_search
Caleb1991 Jul 14, 2021
9e33845
Update poros file, start work on new party
Caleb1991 Jul 14, 2021
f7bc154
Add some more functionality to new viewing party, currently incomplete
Caleb1991 Jul 14, 2021
2ebd2a8
Merge branch 'main' into movie_details_refactor
Caleb1991 Jul 14, 2021
bf76537
Merge pull request #39 from Caleb1991/movie_details_refactor
JoannaCoPo Jul 14, 2021
ba919e5
Add logout functionality
JoannaCoPo Jul 14, 2021
96305c3
Cleanup tests
JoannaCoPo Jul 14, 2021
c482949
Merge pull request #40 from Caleb1991/jo_refactor
Caleb1991 Jul 14, 2021
e07ee3e
Minor refactors to make for better user experience, redirecting to us…
Caleb1991 Jul 14, 2021
7aa0ff1
Merge pull request #41 from Caleb1991/minor_refactor
Caleb1991 Jul 15, 2021
7582bff
Vcr setup
JoannaCoPo Jul 15, 2021
2b9f279
Add a few tests for facade
JoannaCoPo Jul 15, 2021
dc2b3a5
Include setup for webmock attempt
JoannaCoPo Jul 15, 2021
bce0f23
Include setup for webmock attempt
JoannaCoPo Jul 15, 2021
cfbb4db
Final test refactor
JoannaCoPo Jul 15, 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
Prev Previous commit
Next Next commit
Improve naming
JoannaCoPo committed Jul 14, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f98cfad380da70716625892f872efdb46f6759cf
11 changes: 11 additions & 0 deletions app/controllers/movies_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
class MoviesController < ApplicationController
def index
if params['movie_title'] == ''
flash[:error] = 'Field cannot be blank; please try again.'
redirect_to discover_path
elsif params['movie_title']
@search_results = MoviesFacade.search_by_title(params['movie_title'])
else
@top_rate
end
end

def show
@movie = APIFacade.new(params[:id])
end
15 changes: 9 additions & 6 deletions app/facades/movies_facade.rb
Original file line number Diff line number Diff line change
@@ -2,14 +2,17 @@ class MoviesFacade
# def self.find_movie_title(title)
# end

def self.search_by_movie(movie_search)
create_movie_objects(APIServices.get_search_movie(search_movie)[:results])
def self.search_by_movie_title(movie_title)
json = APIServices.movie_title_query(movie_title)
json[:results.map do |result]
Film.new(result)
end.first(40)
end

def self.create_movie_objects(movie_data_via_api)
movie_data_via_api.map do |movie_data|
Film.new(movie_data) #POROS
end
# def self.create_movie_objects(movie_data_via_api)
# movie_data_via_api.map do |movie_data|
# Film.new(movie_data) #POROS
# end
end

#from services > facade > poros > controller
2 changes: 1 addition & 1 deletion app/poros/film_standard.rb → app/poros/film.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class FilmStandard
class Film
attr_reader :id,
:title,
:vote_average,
5 changes: 3 additions & 2 deletions app/services/API_Services.rb
Original file line number Diff line number Diff line change
@@ -8,11 +8,13 @@ class APIServices
# parse_json(response)
# end
#
def self.get_search_movie(search_movie)

def self.movie_title_query(movie_title)
response = conn.get("3/search/movie?query=#{search_movie}")
parse_json(response)
end


def self.conn
Faraday.new(url: 'https://api.themoviedb.org') do |faraday|
faraday.params['api_key'] = ENV['MOVIES_DB_API_KEY']
@@ -58,5 +60,4 @@ def self.movie_details(movie_id)
"Name: #{details[:name]}, Username: #{details[:username]}, Avatar Path: #{details[:avatar_path]}, Rating: #{details[:rating]}"
end
end
require "pry"; binding.pry
end