Skip to content

Commit

Permalink
Temporary Capybara performance regression fix
Browse files Browse the repository at this point in the history
Specs ran in 54 seconds instead of 28 seconds with 1.1
Anyone else seeing this before I investigate it?
  • Loading branch information
bbenezech committed Dec 24, 2012
1 parent c06a566 commit 94a5967
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -34,7 +34,7 @@ end
group :development, :test do
gem 'strong_parameters', '~> 0.1.5'
gem 'cancan', '~> 1.6'
gem 'capybara', '~> 2.0'
gem 'capybara', '~> 1.1'
gem 'carrierwave', '~> 0.6'
gem 'database_cleaner', '~> 0.8'
gem 'devise', '~> 2.1'
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/authorization/cancan_spec.rb
Expand Up @@ -132,7 +132,7 @@ def initialize(user)
fill_in "player[name]", :with => "Jackie Robinson"
fill_in "player[number]", :with => "42"
fill_in "player[position]", :with => "Second baseman"
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
should_not have_content("Edit")

@player = RailsAdmin::AbstractModel.new("Player").first
Expand Down Expand Up @@ -165,7 +165,7 @@ def initialize(user)
should_not have_content("History")
should_not have_content("Show in app")
fill_in "player[name]", :with => "Jackie Robinson"
first(:button, "Save").click
click_button "Save" # click_button "Save" # first(:button, "Save").click
@player.reload
expect(@player.name).to eq("Jackie Robinson")
end
Expand Down
Expand Up @@ -9,7 +9,7 @@
fill_in "player[name]", :with => "Jackie Robinson"
fill_in "player[number]", :with => "42"
fill_in "player[position]", :with => "Second baseman"
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
@player = RailsAdmin::AbstractModel.new("Player").first
end

Expand Down
Expand Up @@ -10,7 +10,7 @@
fill_in "cms_basic_page[title]", :with => "Hello"
fill_in "cms_basic_page[content]", :with => "World"
expect {
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
}.to change(Cms::BasicPage, :count).by(1)
end
end
12 changes: 6 additions & 6 deletions spec/integration/basic/update/rails_admin_basic_update_spec.rb
Expand Up @@ -12,7 +12,7 @@

it "returns to edit page" do
fill_in "player[name]", :with => ""
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
expect(page.driver.status_code).to eq(406)
should have_selector "form[action='#{edit_path(:model_name => "player", :id => @player.id)}']"
end
Expand All @@ -27,7 +27,7 @@
fill_in "player[name]", :with => "Jackie Robinson"
fill_in "player[number]", :with => "42"
fill_in "player[position]", :with => "Second baseman"
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click

@player = RailsAdmin::AbstractModel.new("Player").first
end
Expand Down Expand Up @@ -128,7 +128,7 @@
fill_in "player[name]", :with => "Jackie Robinson"
fill_in "player[number]", :with => "a"
fill_in "player[position]", :with => "Second baseman"
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click

@player.reload
end
Expand All @@ -154,7 +154,7 @@
visit edit_path(:model_name => "user", :id => @user.id)

fill_in "user[roles]", :with => %{['admin', 'user']}
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click

@user.reload
end
Expand All @@ -174,7 +174,7 @@
it "saves the serialized data" do
fill_in "field_test[array_field]", :with => "[4, 2]"
fill_in "field_test[hash_field]", :with => "{ a: 6, b: 2 }"
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click

@field_test.reload
expect(@field_test.array_field).to eq([4, 2])
Expand All @@ -184,7 +184,7 @@
it "clears data when empty string is passed" do
fill_in "field_test[array_field]", :with => ""
fill_in "field_test[hash_field]", :with => ""
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click

@field_test.reload
expect(@field_test.array_field).to eq(nil)
Expand Down
12 changes: 6 additions & 6 deletions spec/integration/config/edit/rails_admin_config_edit_spec.rb
Expand Up @@ -16,7 +16,7 @@
end
visit new_path(:model_name => "field_test")
fill_in "field_test[format]", :with => "test for format"
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
@record = RailsAdmin::AbstractModel.new("FieldTest").first
expect(@record.format).to eq("test for format")
end
Expand Down Expand Up @@ -93,7 +93,7 @@
fill_in "field_test[string_field]", :with => "No problem here"
fill_in "field_test[restricted_field]", :with => "I'm allowed to do that as :custom_role only"
should have_no_selector "field_test[protected_field]"
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
@field_test = FieldTest.first
expect(@field_test.string_field).to eq("No problem here")
expect(@field_test.restricted_field).to eq("I'm allowed to do that as :custom_role only")
Expand Down Expand Up @@ -610,10 +610,10 @@ class HelpTest < Tableless

visit new_path(:model_name => 'category')
should have_no_css('#category_parent_category_id')
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
visit edit_path(:model_name => 'category', :id => Category.first)
should have_css('#category_parent_category_id')
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
should have_content('Category successfully updated')
end
end
Expand All @@ -626,7 +626,7 @@ class HelpTest < Tableless
fill_in "field_test_comment_attributes_content", :with => 'nested comment content'
fill_in "field_test_nested_field_tests_attributes_0_title", :with => 'nested field test title 1 edited'
page.find('#field_test_nested_field_tests_attributes_1__destroy').set('true')
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
@record.reload
expect(@record.comment.content).to eq('nested comment content')
expect(@record.nested_field_tests.length).to eq(1)
Expand Down Expand Up @@ -705,7 +705,7 @@ class HelpTest < Tableless
visit edit_path(:model_name => "field_test", :id => @record.id)
fill_in "field_test_embeds_attributes_0_name", :with => 'embed 1 edited'
page.find('#field_test_embeds_attributes_1__destroy').set('true')
first(:button, "Save").click
click_button "Save" # first(:button, "Save").click
@record.reload
expect(@record.embeds.length).to eq(1)
expect(@record.embeds[0].name).to eq('embed 1 edited')
Expand Down

0 comments on commit 94a5967

Please sign in to comment.