mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 11:10:12 +01:00
Replace be_true and be_false expectations
Removed in RSpec 3.0
This commit is contained in:
parent
7869ef2c74
commit
c19af5b982
4 changed files with 9 additions and 9 deletions
|
|
@ -73,7 +73,7 @@ Given /^I have a (completed|hidden) project called "([^"]*)"$/ do |state, projec
|
|||
step "I have a project called \"#{project_name}\""
|
||||
@project.send(state=="completed" ? "complete!" : "hide!")
|
||||
@project.reload
|
||||
expect(@project.send(state=="completed" ? "completed?" : "hidden?")).to be_true
|
||||
expect(@project.send(state=="completed" ? "completed?" : "hidden?")).to be true
|
||||
end
|
||||
|
||||
Given /^I have (\d+) completed projects$/ do |number_of_projects|
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Given /^I have a repeat pattern called "([^"]*)"$/ do |pattern_name|
|
|||
:created_at => Time.now - 1.day,
|
||||
:completed_at => nil
|
||||
)
|
||||
expect(@recurring_todo.completed?).to be_false
|
||||
expect(@recurring_todo.completed?).to be false
|
||||
@todo = @current_user.todos.create!(
|
||||
:description => pattern_name,
|
||||
:context_id => context.id,
|
||||
|
|
@ -24,7 +24,7 @@ end
|
|||
Given /^I have a completed repeat pattern "([^"]*)"$/ do |pattern_name|
|
||||
step "I have a repeat pattern called \"#{pattern_name}\""
|
||||
@recurring_todo.toggle_completion!
|
||||
expect(@recurring_todo.completed?).to be_true
|
||||
expect(@recurring_todo.completed?).to be true
|
||||
end
|
||||
|
||||
Given /^I have (\d+) completed repeat patterns$/ do |number_of_patterns|
|
||||
|
|
@ -71,7 +71,7 @@ end
|
|||
When /^I mark the pattern "([^"]*)" as (complete|active)$/ do |pattern_name, state|
|
||||
pattern = @current_user.recurring_todos.where(:description => pattern_name).first
|
||||
expect(pattern).to_not be_nil
|
||||
expect(pattern.completed?).to (state=="complete" ? be_false : be_true)
|
||||
expect(pattern.completed?).to be (state != "complete")
|
||||
page.find("#check_#{pattern.id}").click
|
||||
wait_for_ajax
|
||||
wait_for_animations_to_end
|
||||
|
|
@ -89,7 +89,7 @@ Then /^the state list "([^"]*)" should be empty$/ do |state|
|
|||
empty_id = "recurring-todos-empty-nd" if state.downcase == "active"
|
||||
empty_id = "completed-empty-nd" if state.downcase == "completed"
|
||||
empty_msg = page.find("div##{empty_id}")
|
||||
expect(empty_msg.visible?).to be_true
|
||||
expect(empty_msg.visible?).to be true
|
||||
end
|
||||
|
||||
Then /^the pattern "([^\"]*)" should be starred$/ do |pattern_name|
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ end
|
|||
Then /^the selected project should be "([^"]*)"$/ do |content|
|
||||
# Works for mobile. TODO: make it work for both mobile and non-mobile
|
||||
if content.blank?
|
||||
expect(page.has_css?("select#todo_project_id option[selected='selected']")).to be_false
|
||||
expect(page.has_css?("select#todo_project_id option[selected='selected']")).to be false
|
||||
else
|
||||
expect(page.find("select#todo_project_id option[selected='selected']").text).to match(/#{content}/)
|
||||
end
|
||||
|
|
@ -100,7 +100,7 @@ end
|
|||
Then /^the selected context should be "([^"]*)"$/ do |content|
|
||||
# Works for mobile. TODO: make it work for both mobile and non-mobile
|
||||
if content.blank?
|
||||
expect(page.has_css?("select#todo_context_id option[selected='selected']")).to be_false
|
||||
expect(page.has_css?("select#todo_context_id option[selected='selected']")).to be false
|
||||
else
|
||||
expect(page.find("select#todo_context_id option[selected='selected']").text).to match(/#{content}/)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -149,14 +149,14 @@ end
|
|||
Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |label, selector|
|
||||
with_scope(selector) do
|
||||
field_checked = find_field(label)['checked']
|
||||
expect(field_checked).to be_true
|
||||
expect(field_checked).to be true
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |label, selector|
|
||||
with_scope(selector) do
|
||||
field_checked = find_field(label)['checked']
|
||||
expect(field_checked).to be_false
|
||||
expect(field_checked).to be false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue