Removing ambiguity and non-working selectors

This commit is contained in:
Dmitriy Zaporozhets 2013-02-21 13:28:05 +02:00
parent 5aeaf248f1
commit cce14e0b01
4 changed files with 8 additions and 6 deletions

View file

@ -82,7 +82,6 @@ describe "Admin::Users" do
it "should have user info" do it "should have user info" do
page.should have_content(@user.email) page.should have_content(@user.email)
page.should have_content(@user.name) page.should have_content(@user.name)
page.should have_content(@user.projects_limit)
end end
end end

View file

@ -18,7 +18,7 @@ describe "On a merge request", js: true do
it { should have_css(".js-main-target-form", visible: true, count: 1) } it { should have_css(".js-main-target-form", visible: true, count: 1) }
# button initalization # 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") } } it { within(".js-main-target-form") { should_not have_link("Cancel") } }
# notifiactions # notifiactions
@ -136,7 +136,7 @@ describe "On a merge request diff", js: true, focus: true do
end end
it "should be removed when canceled" do 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") should have_no_css(".js-temp-notes-holder")
end end

View file

@ -17,7 +17,7 @@ describe "On the project wall", js: true do
it { should have_css(".js-main-target-form", visible: true, count: 1) } it { should have_css(".js-main-target-form", visible: true, count: 1) }
# button initalization # 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") } } it { within(".js-main-target-form") { should_not have_link("Cancel") } }
# notifiactions # notifiactions

View file

@ -6,9 +6,12 @@ describe "Search" do
@project = create(:project) @project = create(:project)
@project.team << [@user, :reporter] @project.team << [@user, :reporter]
visit search_path visit search_path
within '.search-holder' do
fill_in "search", with: @project.name[0..3] fill_in "search", with: @project.name[0..3]
click_button "Search" click_button "Search"
end end
end
it "should show project in search results" do it "should show project in search results" do
page.should have_content @project.name page.should have_content @project.name