spec/integration/buttons_spec.rb in edit_mode-0.0.6 vs spec/integration/buttons_spec.rb in edit_mode-0.0.7
- old
+ new
@@ -6,9 +6,28 @@
@user = User.new( first_name: "John", last_name: "Doe", date_of_birth: "1995-12-21" )
@user.save
visit user_path( @user )
end
+ describe "javascript requirements: " do
+ describe "edit event" do
+ describe "on a best_in_place element" do
+ it "should show the input field for editing" do
+ page.should_not have_selector "input"
+ page.execute_script( " $('.best_in_place.editable:first').trigger('edit') " )
+ page.should have_selector( "input", count: 1 )
+ end
+ end
+ describe "on an edit_mode_group" do
+ it "should show the input fields for all contained best_in_place fields" do
+ page.should_not have_selector "input"
+ page.execute_script( " $('.edit_mode_group:first').trigger('edit') " )
+ page.should have_selector( "input", count: 2 )
+ end
+ end
+ end
+ end
+
describe "edit button" do
it "should be visible outside and invisible in edit mode" do
page.should have_selector( ".edit_button", visible: true, count: 2 )
click_on 'edit'