From cce14e0b0133ec6e8f380a23a6309bb52e67cc20 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 21 Feb 2013 13:28:05 +0200 Subject: [PATCH] Removing ambiguity and non-working selectors --- spec/features/admin/admin_users_spec.rb | 1 - spec/features/notes_on_merge_requests_spec.rb | 4 ++-- spec/features/notes_on_wall_spec.rb | 2 +- spec/features/search_spec.rb | 7 +++++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 455caf4a..77d6e9e3 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -82,7 +82,6 @@ describe "Admin::Users" do it "should have user info" do page.should have_content(@user.email) page.should have_content(@user.name) - page.should have_content(@user.projects_limit) end end diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb index 37fc85c8..06e18195 100644 --- a/spec/features/notes_on_merge_requests_spec.rb +++ b/spec/features/notes_on_merge_requests_spec.rb @@ -18,7 +18,7 @@ describe "On a merge request", js: true do it { should have_css(".js-main-target-form", visible: true, count: 1) } # button initalization - it { within(".js-main-target-form") { should have_button("Add Comment") } } + it { find(".js-main-target-form input[type=submit]").value.should == "Add Comment" } it { within(".js-main-target-form") { should_not have_link("Cancel") } } # notifiactions @@ -136,7 +136,7 @@ describe "On a merge request diff", js: true, focus: true do end it "should be removed when canceled" do - find(".js-close-discussion-note-form").trigger("click") + first(".js-close-discussion-note-form").trigger("click") should have_no_css(".js-temp-notes-holder") end diff --git a/spec/features/notes_on_wall_spec.rb b/spec/features/notes_on_wall_spec.rb index 4adcf74e..1281f2b1 100644 --- a/spec/features/notes_on_wall_spec.rb +++ b/spec/features/notes_on_wall_spec.rb @@ -17,7 +17,7 @@ describe "On the project wall", js: true do it { should have_css(".js-main-target-form", visible: true, count: 1) } # button initalization - it { within(".js-main-target-form") { should have_button("Add Comment") } } + it { find(".js-main-target-form input[type=submit]").value.should == "Add Comment" } it { within(".js-main-target-form") { should_not have_link("Cancel") } } # notifiactions diff --git a/spec/features/search_spec.rb b/spec/features/search_spec.rb index e338f359..5ce4cae3 100644 --- a/spec/features/search_spec.rb +++ b/spec/features/search_spec.rb @@ -6,8 +6,11 @@ describe "Search" do @project = create(:project) @project.team << [@user, :reporter] visit search_path - fill_in "search", with: @project.name[0..3] - click_button "Search" + + within '.search-holder' do + fill_in "search", with: @project.name[0..3] + click_button "Search" + end end it "should show project in search results" do