From a3204ed60e2f25e5231ddf8e18e4124b157e8ee4 Mon Sep 17 00:00:00 2001 From: Anita Graham Date: Thu, 7 May 2015 21:51:15 +0800 Subject: Use find/trigger(:click) instead of click_link --- spec/features/refinery/blog/admin/posts_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spec/features') diff --git a/spec/features/refinery/blog/admin/posts_spec.rb b/spec/features/refinery/blog/admin/posts_spec.rb index 2c7b82c..99ec25d 100644 --- a/spec/features/refinery/blog/admin/posts_spec.rb +++ b/spec/features/refinery/blog/admin/posts_spec.rb @@ -33,7 +33,7 @@ module Refinery end it "should have category title", :js => true do - click_link "toggle_advanced_options" + find('#toggle_advanced_options').click expect(page).to have_content(blog_category.title) end @@ -45,14 +45,14 @@ module Refinery # this is a dirty hack but textarea that needs to be filled is # hidden and capybara refuses to fill in elements it can't see page.evaluate_script("WYMeditor.INSTANCES[0].html('

And I love it

')") - click_link "toggle_advanced_options" - sleep 1 + find('#toggle_advanced_options').click expect(page).to have_css '.blog_categories' expect(page).to have_css "#post_category_ids_#{blog_category.id}" expect(page).to have_selector("#post_category_ids_#{blog_category.id}:not(:checked)") check blog_category.title expect(page).to have_selector("#post_category_ids_#{blog_category.id}:checked") click_button "Save" + sleep 1 expect(page).to have_content("was successfully added.") end @@ -170,7 +170,7 @@ module Refinery # hidden and capybara refuses to fill in elements it can't see page.evaluate_script("WYMeditor.INSTANCES[0].html('

I totally did not write it.

')") - click_link "toggle_advanced_options" + find('a', text: 'Toggle Advanced Options').trigger(:click) expect(page).to have_content("Author") select other_guy.username, :from => "Author" -- cgit v1.2.3