mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-02 07:18:49 +01:00
Use RSpec 'expect' instead of 'should'
This commit is contained in:
parent
4ee8c2e7fd
commit
7a3f90a020
20 changed files with 208 additions and 248 deletions
|
|
@ -10,9 +10,9 @@ When /^I delete the first note$/ do
|
|||
handle_js_confirm do
|
||||
click_link "delete_note_#{id}"
|
||||
end
|
||||
get_confirm_text.should == "Are you sure that you want to delete the note '#{id}'?"
|
||||
expect(get_confirm_text).to eq("Are you sure that you want to delete the note '#{id}'?")
|
||||
|
||||
page.should_not have_css("a#delete_note_#{id}")
|
||||
expect(page).to_not have_css("a#delete_note_#{id}")
|
||||
end
|
||||
|
||||
When /^I click the icon next to the note$/ do
|
||||
|
|
@ -32,7 +32,7 @@ end
|
|||
|
||||
When(/^I toggle the note of "([^"]*)"$/) do |todo_description|
|
||||
todo = @current_user.todos.where(:description => todo_description).first
|
||||
todo.should_not be_nil
|
||||
expect(todo).to_not be_nil
|
||||
|
||||
xpath = "//div[@id='line_todo_#{todo.id}']/div/a/img"
|
||||
page.find(:xpath, xpath).click
|
||||
|
|
@ -52,7 +52,7 @@ Then /^(.*) notes should be visible$/ do |number|
|
|||
# count number of project_notes
|
||||
count = 0
|
||||
page.all("div.project_notes").each { |node| count += 1 }
|
||||
count.should == number.to_i
|
||||
expect(count).to eq(number.to_i)
|
||||
end
|
||||
|
||||
Then /^I should see note "([^\"]*)" on the "([^\"]*)" project page$/ do |note, project|
|
||||
|
|
@ -71,7 +71,7 @@ Then /^the first note should disappear$/ do
|
|||
id = title.split(' ').last
|
||||
note = "div#note_#{id}"
|
||||
|
||||
page.should_not have_css(note, :visible=>true)
|
||||
expect(page).to_not have_css(note, :visible=>true)
|
||||
end
|
||||
|
||||
Then /^I should see the note text$/ do
|
||||
|
|
@ -79,9 +79,9 @@ Then /^I should see the note text$/ do
|
|||
end
|
||||
|
||||
Then /^I should not see the note "([^"]*)"$/ do |note_content|
|
||||
page.should_not have_selector("div", :text => note_content, :visible => true)
|
||||
expect(page).to_not have_selector("div", :text => note_content, :visible => true)
|
||||
end
|
||||
|
||||
Then /^I should see the note "([^"]*)"$/ do |note_content|
|
||||
page.all("div", :text => note_content).first.should be_visible
|
||||
end
|
||||
expect(page.all("div", :text => note_content).first).to be_visible
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue