Skip to content

Commit

Permalink
[Models] more specs
Browse files Browse the repository at this point in the history
  • Loading branch information
bramswenson committed Oct 31, 2011
1 parent add1929 commit a29b5f5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/app/models/album_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@

describe Imagine::Album do
it { should validate_presence_of(:name) }
it { should have_many(:images) }
if Imagine.orm == :mongoid
context "with Mongoid" do
it { should have_field(:name).of_type(String) }
it { should be_timestamped_document }
end
end
end
8 changes: 8 additions & 0 deletions spec/app/models/image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@

describe Imagine::Image do
it { should validate_presence_of(:file) }
it { should belong_to(:album) }
if Imagine.orm == :mongoid
context "with Mongoid" do
it { should have_field(:file_name).of_type(String) }
it { should have_field(:file_uid).of_type(String) }
it { should be_timestamped_document }
end
end
end

0 comments on commit a29b5f5

Please sign in to comment.