Permalink
Browse files

Moving paperclip presence tests from integration to base_spec.rb.

  • Loading branch information...
1 parent 147a20d commit 0db4fe235bc9a74035fd8e878285dc5407ae36b7 Fernando Morgenstern committed Oct 27, 2012
@@ -106,13 +106,4 @@
page.current_url.should == 'http://www.example.com/admin/ball?sort=color'
end
end
-
- describe "image edit" do
- it "should show required for paperclip attached file with validates_attachment_presence" do
- @image = FactoryGirl.create :image
- visit edit_path(:model_name => "image", :id => @image.id)
-
- should have_selector("div", :text => /Required./)
- end
- end
end
@@ -70,12 +70,4 @@
page.should have_css("select#team_player_ids option[selected='selected'][value='#{@player.id}']")
end
end
-
- describe "GET /admin/image/new" do
- it "should show required for paperclip attached file with validates_attachment_presence" do
- visit new_path(:model_name => "image")
-
- should have_selector("div", :text => /File\s*Required/)
- end
- end
end
@@ -11,6 +11,12 @@
RailsAdmin.config('Ball').fields.first.with(:object => Ball.new).should be_required
RailsAdmin.config('Ball').fields.first.with(:object => FactoryGirl.create(:ball)).should_not be_required
end
+
+ context 'on a Paperclip installation' do
+ it "should detect required fields" do
+ RailsAdmin.config('Image').fields.find{ |f| f.name == :file }.with(:object => Image.new).should be_required
+ end
+ end
end
describe "#name" do

0 comments on commit 0db4fe2

Please sign in to comment.