From c19af5b982d5eba000647055b34e026da69370ff Mon Sep 17 00:00:00 2001 From: Dan Rice Date: Wed, 25 Jun 2014 17:10:27 -0400 Subject: [PATCH] Replace be_true and be_false expectations Removed in RSpec 3.0 --- features/step_definitions/project_steps.rb | 2 +- features/step_definitions/recurring_todo_steps.rb | 8 ++++---- features/step_definitions/todo_steps.rb | 4 ++-- features/step_definitions/web_steps.rb | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index 2e177e5e..f7ce8814 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -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| diff --git a/features/step_definitions/recurring_todo_steps.rb b/features/step_definitions/recurring_todo_steps.rb index e1c5535e..a417352b 100644 --- a/features/step_definitions/recurring_todo_steps.rb +++ b/features/step_definitions/recurring_todo_steps.rb @@ -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| diff --git a/features/step_definitions/todo_steps.rb b/features/step_definitions/todo_steps.rb index 6bb11532..1a26d905 100644 --- a/features/step_definitions/todo_steps.rb +++ b/features/step_definitions/todo_steps.rb @@ -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 diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 69470a2f..f3e8a091 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -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