Skip to content

Commit

Permalink
Merge pull request #11 from aevans27/dashboard-viewing-parties-allan
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchilidawg authored Dec 1, 2023
2 parents 461d335 + df1083f commit d94df44
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<% @movies.each do |movie| %>
<% if party.movie_id == movie[:id] %>
<li><strong>Movie Image: </strong><%= image_tag "https://image.tmdb.org/t/p/w92#{movie[:poster_path]}" %></li>
<li><strong>Movie Title: </strong><%= "#{movie[:title]}" %></li>
<li><strong>Movie Title: </strong><%= link_to "#{movie[:title]}", "/users/#{@user.id}/movies/#{movie[:id]}" %></li>
<li><strong>Date and Time: </strong><%= "Starts on #{party.date} at #{party.start_time}" %></li>
<% party.user_parties.each do |us| %>
<% if us.is_host == true %>
Expand All @@ -35,7 +35,7 @@
<% @movies.each do |movie| %>
<% if party.movie_id == movie[:id] %>
<li><strong>Movie Image: </strong><%= image_tag "https://image.tmdb.org/t/p/w92#{movie[:poster_path]}" %></li>
<li><strong>Movie Title: </strong><%= "#{movie[:title]}" %></li>
<li><strong>Movie Title: </strong><%= link_to "#{movie[:title]}", "/users/#{@user.id}/movies/#{movie[:id]}" %></li>
<li><strong>Date and Time: </strong><%= "Starts on #{party.date} at #{party.start_time}" %></li>
<% party.user_parties.each do |us| %>
<% if us.is_host == true %>
Expand Down
5 changes: 5 additions & 0 deletions spec/features/users/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
expect(page).to have_button('Discover Movies')
end

it "displays a 'Discover Movies' movie links" do
expect(page).to have_link('The Lord of the Rings: The Fellowship of the Ring')
expect(page).to have_link('Star Wars')
end

it 'displays a section that lists viewing parties' do
within('section.attending-parties') do
expect(page).to have_css('h2', text: 'Attending Parties')
Expand Down
13 changes: 13 additions & 0 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,17 @@
it { should have_many :user_parties }
it { should have_many(:parties).through(:user_parties) }
end

describe "validations" do
it {should validate_presence_of(:name)}
it {should validate_presence_of(:email)}
it { should validate_presence_of(:password)}
it { should have_secure_password}

it "create user with validations" do
user = User.create(name: 'Joe', email: 'joe@test.com', password: 'password123', password_confirmation: 'password123')
expect(user).to_not have_attribute(:password)
expect(user.password_digest).to_not eq('password123')
end
end
end

0 comments on commit d94df44

Please sign in to comment.