mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Add photo model spec.
This commit is contained in:
parent
12a7eed623
commit
fcd4a6d6bf
11
spec/models/photo_spec.rb
Normal file
11
spec/models/photo_spec.rb
Normal file
@ -0,0 +1,11 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Photo do
|
||||
it { should have_and_belong_to_many(:categories) }
|
||||
|
||||
let(:photo) { create(:photo) }
|
||||
|
||||
it "logs a view" do
|
||||
expect { photo.log_view }.to change{photo.views}.by(1)
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user