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