Commit 0f263193bedd00378b03d90a590f680dfb9ba1e6
1 parent
dc161eb7
Exists in
master
and in
20 other branches
rspec3: migrate be_true and be_false
Showing
4 changed files
with
24 additions
and
24 deletions
Show diff stats
features/step_definitions/activate_enterprise_steps.rb
| @@ -5,7 +5,7 @@ Given /^I fill in "([^\"]*)" with code of "([^\"]*)"$/ do |field, enterprise| | @@ -5,7 +5,7 @@ Given /^I fill in "([^\"]*)" with code of "([^\"]*)"$/ do |field, enterprise| | ||
| 5 | end | 5 | end |
| 6 | 6 | ||
| 7 | Given /^enterprise "([^\"]*)" should be enabled$/ do |enterprise| | 7 | Given /^enterprise "([^\"]*)" should be enabled$/ do |enterprise| |
| 8 | - Enterprise.find_by_name(enterprise).enabled?.should be_true | 8 | + Enterprise.find_by_name(enterprise).enabled?.should be_truthy |
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | Given /^"([^\"]*)" is the active enterprise template$/ do |enterprise| | 11 | Given /^"([^\"]*)" is the active enterprise template$/ do |enterprise| |
| @@ -26,34 +26,34 @@ end | @@ -26,34 +26,34 @@ end | ||
| 26 | Given /^"([^\"]*)" has "([^\"]*)" as template$/ do |ent, templ| | 26 | Given /^"([^\"]*)" has "([^\"]*)" as template$/ do |ent, templ| |
| 27 | template = Enterprise.find_by_name(templ) | 27 | template = Enterprise.find_by_name(templ) |
| 28 | enterprise = Enterprise.find_by_name(ent) | 28 | enterprise = Enterprise.find_by_name(ent) |
| 29 | - (template.boxes.size == enterprise.boxes.size).should be_true | ||
| 30 | - (template.layout_template == enterprise.layout_template).should be_true | ||
| 31 | - (template.theme == enterprise.theme).should be_true | ||
| 32 | - (template.custom_header == enterprise.custom_header).should be_true | ||
| 33 | - (template.custom_footer == enterprise.custom_footer).should be_true | 29 | + (template.boxes.size == enterprise.boxes.size).should be_truthy |
| 30 | + (template.layout_template == enterprise.layout_template).should be_truthy | ||
| 31 | + (template.theme == enterprise.theme).should be_truthy | ||
| 32 | + (template.custom_header == enterprise.custom_header).should be_truthy | ||
| 33 | + (template.custom_footer == enterprise.custom_footer).should be_truthy | ||
| 34 | end | 34 | end |
| 35 | 35 | ||
| 36 | Given /^"([^\"]*)" doesnt have "([^\"]*)" as template$/ do |ent, templ| | 36 | Given /^"([^\"]*)" doesnt have "([^\"]*)" as template$/ do |ent, templ| |
| 37 | template = Enterprise.find_by_name(templ) | 37 | template = Enterprise.find_by_name(templ) |
| 38 | enterprise = Enterprise.find_by_name(ent) | 38 | enterprise = Enterprise.find_by_name(ent) |
| 39 | - (template.boxes.size == enterprise.boxes.size).should be_false | ||
| 40 | - (template.layout_template == enterprise.layout_template).should be_false | ||
| 41 | - (template.theme == enterprise.theme).should be_false | ||
| 42 | - (template.custom_header == enterprise.custom_header).should be_false | ||
| 43 | - (template.custom_footer == enterprise.custom_footer).should be_false | 39 | + (template.boxes.size == enterprise.boxes.size).should be_falsey |
| 40 | + (template.layout_template == enterprise.layout_template).should be_falsey | ||
| 41 | + (template.theme == enterprise.theme).should be_falsey | ||
| 42 | + (template.custom_header == enterprise.custom_header).should be_falsey | ||
| 43 | + (template.custom_footer == enterprise.custom_footer).should be_falsey | ||
| 44 | end | 44 | end |
| 45 | 45 | ||
| 46 | Given /^enterprise "([^\"]*)" is enabled$/ do |enterprise| | 46 | Given /^enterprise "([^\"]*)" is enabled$/ do |enterprise| |
| 47 | Enterprise.find_by_name(enterprise).update_attribute(:enabled,true) | 47 | Enterprise.find_by_name(enterprise).update_attribute(:enabled,true) |
| 48 | - Enterprise.find_by_name(enterprise).enabled?.should be_true | 48 | + Enterprise.find_by_name(enterprise).enabled?.should be_truthy |
| 49 | end | 49 | end |
| 50 | 50 | ||
| 51 | Given /^enterprise "([^\"]*)" should be blocked$/ do |enterprise| | 51 | Given /^enterprise "([^\"]*)" should be blocked$/ do |enterprise| |
| 52 | - Enterprise.find_by_name(enterprise).blocked?.should be_true | 52 | + Enterprise.find_by_name(enterprise).blocked?.should be_truthy |
| 53 | end | 53 | end |
| 54 | 54 | ||
| 55 | Given /^enterprise "([^\"]*)" should not be blocked$/ do |enterprise| | 55 | Given /^enterprise "([^\"]*)" should not be blocked$/ do |enterprise| |
| 56 | - Enterprise.find_by_name(enterprise).blocked?.should_not be_true | 56 | + Enterprise.find_by_name(enterprise).blocked?.should_not be_truthy |
| 57 | end | 57 | end |
| 58 | 58 | ||
| 59 | Given /^enterprise template must be replaced after enable$/ do | 59 | Given /^enterprise template must be replaced after enable$/ do |
features/step_definitions/custom_web_steps.rb
| @@ -24,12 +24,12 @@ end | @@ -24,12 +24,12 @@ end | ||
| 24 | 24 | ||
| 25 | Then /^the "([^"]*)" button should be disabled$/ do |selector| | 25 | Then /^the "([^"]*)" button should be disabled$/ do |selector| |
| 26 | field = find(selector) | 26 | field = find(selector) |
| 27 | - field['disabled'].should be_true | 27 | + field['disabled'].should be_truthy |
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | Then /^the "([^"]*)" button should be enabled$/ do |selector| | 30 | Then /^the "([^"]*)" button should be enabled$/ do |selector| |
| 31 | field = find(selector) | 31 | field = find(selector) |
| 32 | - field['disabled'].should_not be_true | 32 | + field['disabled'].should_not be_truthy |
| 33 | end | 33 | end |
| 34 | 34 | ||
| 35 | When /^I reload and wait for the page$/ do | 35 | When /^I reload and wait for the page$/ do |
features/step_definitions/noosfero_steps.rb
| @@ -534,7 +534,7 @@ end | @@ -534,7 +534,7 @@ end | ||
| 534 | 534 | ||
| 535 | Then /^I should receive an e-mail on (.*)$/ do |address| | 535 | Then /^I should receive an e-mail on (.*)$/ do |address| |
| 536 | last_mail = ActionMailer::Base.deliveries.last | 536 | last_mail = ActionMailer::Base.deliveries.last |
| 537 | - last_mail.nil?.should be_false | 537 | + last_mail.nil?.should be_falsey |
| 538 | last_mail['to'].to_s.should == address | 538 | last_mail['to'].to_s.should == address |
| 539 | end | 539 | end |
| 540 | 540 | ||
| @@ -545,16 +545,16 @@ end | @@ -545,16 +545,16 @@ end | ||
| 545 | 545 | ||
| 546 | Then /^there should be an? (.+) named "([^\"]*)"$/ do |klass_name, profile_name| | 546 | Then /^there should be an? (.+) named "([^\"]*)"$/ do |klass_name, profile_name| |
| 547 | klass = klass_name.camelize.constantize | 547 | klass = klass_name.camelize.constantize |
| 548 | - klass.find_by_name(profile_name).nil?.should be_false | 548 | + klass.find_by_name(profile_name).nil?.should be_falsey |
| 549 | end | 549 | end |
| 550 | 550 | ||
| 551 | Then /^"([^\"]*)" profile should exist$/ do |profile_selector| | 551 | Then /^"([^\"]*)" profile should exist$/ do |profile_selector| |
| 552 | profile = nil | 552 | profile = nil |
| 553 | begin | 553 | begin |
| 554 | profile = Profile.find_by_name(profile_selector) | 554 | profile = Profile.find_by_name(profile_selector) |
| 555 | - profile.nil?.should be_false | 555 | + profile.nil?.should be_falsey |
| 556 | rescue | 556 | rescue |
| 557 | - profile.nil?.should be_false | 557 | + profile.nil?.should be_falsey |
| 558 | end | 558 | end |
| 559 | end | 559 | end |
| 560 | 560 | ||
| @@ -562,9 +562,9 @@ Then /^"([^\"]*)" profile should not exist$/ do |profile_selector| | @@ -562,9 +562,9 @@ Then /^"([^\"]*)" profile should not exist$/ do |profile_selector| | ||
| 562 | profile = nil | 562 | profile = nil |
| 563 | begin | 563 | begin |
| 564 | profile = Profile.find_by_name(profile_selector) | 564 | profile = Profile.find_by_name(profile_selector) |
| 565 | - profile.nil?.should be_true | 565 | + profile.nil?.should be_truthy |
| 566 | rescue | 566 | rescue |
| 567 | - profile.nil?.should be_true | 567 | + profile.nil?.should be_truthy |
| 568 | end | 568 | end |
| 569 | end | 569 | end |
| 570 | 570 |
features/step_definitions/web_steps.rb
| @@ -203,7 +203,7 @@ Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |labe | @@ -203,7 +203,7 @@ Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |labe | ||
| 203 | with_scope(selector) do | 203 | with_scope(selector) do |
| 204 | field_checked = find_field(label)['checked'] | 204 | field_checked = find_field(label)['checked'] |
| 205 | if field_checked.respond_to? :should | 205 | if field_checked.respond_to? :should |
| 206 | - field_checked.should be_true | 206 | + field_checked.should be_truthy |
| 207 | else | 207 | else |
| 208 | assert field_checked | 208 | assert field_checked |
| 209 | end | 209 | end |
| @@ -214,7 +214,7 @@ Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do | | @@ -214,7 +214,7 @@ Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do | | ||
| 214 | with_scope(selector) do | 214 | with_scope(selector) do |
| 215 | field_checked = find_field(label)['checked'] | 215 | field_checked = find_field(label)['checked'] |
| 216 | if field_checked.respond_to? :should | 216 | if field_checked.respond_to? :should |
| 217 | - field_checked.should be_false | 217 | + field_checked.should be_falsey |
| 218 | else | 218 | else |
| 219 | assert !field_checked | 219 | assert !field_checked |
| 220 | end | 220 | end |