Skip to content

Commit

Permalink
wrote tests for movie model relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
J-C-L committed May 9, 2017
1 parent 9b7b69c commit da83423
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/fixtures/rentals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ three:
due_date: 2017-05-09

four:
movie: exorcist:
movie: exorcist
customer: curran
checked_out: false
due_date: 2017-05-09
12 changes: 11 additions & 1 deletion test/models/movie_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
describe Movie do

describe "relations" do

it "has a list of rentals" do
psycho = movies(:psycho)
psycho.must_respond_to :rentals
psycho.rentals.each do |rental|
rental.must_be_kind_of Rental
end
end

it "has a list of customers" do
psycho = movies(:psycho)
psycho.must_respond_to :customers
psycho.customers.each do |customer|
customer.must_be_kind_of Customer
end
end

end

end

0 comments on commit da83423

Please sign in to comment.