diff --git a/spec/views/comments/index.rss.haml_spec.rb b/spec/views/comments/index.rss.haml_spec.rb index 7fce693a7..ff8df501b 100644 --- a/spec/views/comments/index.rss.haml_spec.rb +++ b/spec/views/comments/index.rss.haml_spec.rb @@ -15,11 +15,11 @@ describe 'comments/index.rss.haml' do end it 'shows RSS feed title' do - rendered.should have_content "Recent comments on all posts" + expect(rendered).to have_content "Recent comments on all posts" end it 'shows item title' do - rendered.should have_content "Comment by #{@author.login_name}" + expect(rendered).to have_content "Comment by #{@author.login_name}" end it 'escapes html for link to post' do @@ -28,6 +28,6 @@ describe 'comments/index.rss.haml' do end it 'shows content of comments' do - rendered.should have_content "OMG LOL" + expect(rendered).to have_content "OMG LOL" end end diff --git a/spec/views/crops/_grown_for.html.haml_spec.rb b/spec/views/crops/_grown_for.html.haml_spec.rb index 68f20617c..77d2183c6 100644 --- a/spec/views/crops/_grown_for.html.haml_spec.rb +++ b/spec/views/crops/_grown_for.html.haml_spec.rb @@ -13,7 +13,7 @@ describe "crops/_grown_for" do it 'shows plant parts' do render partial: 'crops/grown_for', locals: { crop: } - rendered.should have_content plant_path.name + expect(rendered).to have_content plant_path.name assert_select "a", href: plant_part_path(plant_path) end end diff --git a/spec/views/crops/_popover.html.haml_spec.rb b/spec/views/crops/_popover.html.haml_spec.rb index 2b921f97b..a4a81bc5f 100644 --- a/spec/views/crops/_popover.html.haml_spec.rb +++ b/spec/views/crops/_popover.html.haml_spec.rb @@ -12,10 +12,10 @@ describe "crops/_popover" do end it 'has a scientific name' do - rendered.should have_content 'Solanum lycopersicum' + expect(rendered).to have_content 'Solanum lycopersicum' end it 'shows count of plantings' do - rendered.should have_content '1 time' + expect(rendered).to have_content '1 time' end end diff --git a/spec/views/crops/index.html.haml_spec.rb b/spec/views/crops/index.html.haml_spec.rb index b24e8e958..54cd94e85 100644 --- a/spec/views/crops/index.html.haml_spec.rb +++ b/spec/views/crops/index.html.haml_spec.rb @@ -33,7 +33,7 @@ describe "crops/index.html.haml" do context "downloads" do it "offers data downloads" do render - rendered.should have_content "The data on this page is available in the following formats:" + expect(rendered).to have_content "The data on this page is available in the following formats:" assert_select "a", href: crops_path(format: 'csv') assert_select "a", href: crops_path(format: 'json') assert_select "a", href: crops_path(format: 'rss') diff --git a/spec/views/crops/index.rss.haml_spec.rb b/spec/views/crops/index.rss.haml_spec.rb index 60700523f..a47b62c9c 100644 --- a/spec/views/crops/index.rss.haml_spec.rb +++ b/spec/views/crops/index.rss.haml_spec.rb @@ -13,11 +13,11 @@ describe 'crops/index.rss.haml' do end it 'shows RSS feed title' do - rendered.should have_content "Recently added crops" + expect(rendered).to have_content "Recently added crops" end it 'shows names of crops' do - rendered.should have_content @tomato.name - rendered.should have_content @maize.name + expect(rendered).to have_content @tomato.name + expect(rendered).to have_content @maize.name end end diff --git a/spec/views/devise/confirmations/new_spec.rb b/spec/views/devise/confirmations/new_spec.rb index ce4290259..7de408dfd 100644 --- a/spec/views/devise/confirmations/new_spec.rb +++ b/spec/views/devise/confirmations/new_spec.rb @@ -10,6 +10,6 @@ describe 'devise/confirmations/new.html.haml', type: "view" do end it 'contains a login field' do - rendered.should have_content "Enter either your login name or your email address" + expect(rendered).to have_content "Enter either your login name or your email address" end end diff --git a/spec/views/devise/mailer/confirmation_instructions_spec.rb b/spec/views/devise/mailer/confirmation_instructions_spec.rb index a600a370b..34c5e1993 100644 --- a/spec/views/devise/mailer/confirmation_instructions_spec.rb +++ b/spec/views/devise/mailer/confirmation_instructions_spec.rb @@ -10,11 +10,11 @@ describe 'devise/mailer/confirmation_instructions.html.haml', type: "view" do end it 'has a confirmation link' do - rendered.should have_content 'Confirm my account' + expect(rendered).to have_content 'Confirm my account' end it 'has a link to the homepage' do - rendered.should have_content root_url + expect(rendered).to have_content root_url end end end diff --git a/spec/views/devise/mailer/reset_password_instructions_spec.rb b/spec/views/devise/mailer/reset_password_instructions_spec.rb index 7dce3e1f7..eb3371708 100644 --- a/spec/views/devise/mailer/reset_password_instructions_spec.rb +++ b/spec/views/devise/mailer/reset_password_instructions_spec.rb @@ -12,8 +12,8 @@ describe 'devise/mailer/reset_password_instructions.html.haml', type: "view" do end it 'has some of the right text' do - rendered.should have_content 'Change my password' - rendered.should have_content 'Someone has requested a link to reset your password' + expect(rendered).to have_content 'Change my password' + expect(rendered).to have_content 'Someone has requested a link to reset your password' end end end diff --git a/spec/views/devise/mailer/unlock_instructions_spec.rb b/spec/views/devise/mailer/unlock_instructions_spec.rb index 6a3cb8a55..0d2e1cb37 100644 --- a/spec/views/devise/mailer/unlock_instructions_spec.rb +++ b/spec/views/devise/mailer/unlock_instructions_spec.rb @@ -9,11 +9,11 @@ describe 'devise/mailer/unlock_instructions.html.haml', type: "view" do end it "explains what's happened" do - rendered.should have_content "account has been locked" + expect(rendered).to have_content "account has been locked" end it "has an unlock link" do - rendered.should have_content "Unlock my account" + expect(rendered).to have_content "Unlock my account" end end end diff --git a/spec/views/devise/registrations/edit_spec.rb b/spec/views/devise/registrations/edit_spec.rb index d09090e49..546da02f4 100644 --- a/spec/views/devise/registrations/edit_spec.rb +++ b/spec/views/devise/registrations/edit_spec.rb @@ -16,7 +16,7 @@ describe 'devise/registrations/edit.html.haml', type: "view" do it 'has some fields' do render - rendered.should have_content 'Email' + expect(rendered).to have_content 'Email' end context 'email section' do diff --git a/spec/views/devise/registrations/new_spec.rb b/spec/views/devise/registrations/new_spec.rb index 05c690ca9..e4e7ef3d2 100644 --- a/spec/views/devise/registrations/new_spec.rb +++ b/spec/views/devise/registrations/new_spec.rb @@ -13,7 +13,7 @@ describe 'devise/registrations/new.html.haml', type: "view" do end it 'has some fields' do - rendered.should have_content 'Email' + expect(rendered).to have_content 'Email' end it 'has a checkbox for newsletter subscription' do diff --git a/spec/views/devise/sessions/new_spec.rb b/spec/views/devise/sessions/new_spec.rb index 5537f6fd9..22f81d034 100644 --- a/spec/views/devise/sessions/new_spec.rb +++ b/spec/views/devise/sessions/new_spec.rb @@ -13,8 +13,8 @@ describe 'devise/sessions/new.html.haml', type: "view" do end it 'has some fields' do - rendered.should have_content 'Remember me' - rendered.should have_content 'Password' + expect(rendered).to have_content 'Remember me' + expect(rendered).to have_content 'Password' end end end diff --git a/spec/views/home/_blurb.html.haml_spec.rb b/spec/views/home/_blurb.html.haml_spec.rb index 2fc293133..cf2e4a90a 100644 --- a/spec/views/home/_blurb.html.haml_spec.rb +++ b/spec/views/home/_blurb.html.haml_spec.rb @@ -10,7 +10,7 @@ describe 'home/_blurb.html.haml', type: "view" do end it 'has description' do - rendered.should have_content 'is a community of food gardeners' + expect(rendered).to have_content 'is a community of food gardeners' end it 'has signup section' do @@ -19,7 +19,7 @@ describe 'home/_blurb.html.haml', type: "view" do end it 'has a link to sign in' do - rendered.should have_content "Or sign in if you already have an account" + expect(rendered).to have_content "Or sign in if you already have an account" assert_select "a", href: new_member_session_path end end diff --git a/spec/views/home/_stats.html.haml_spec.rb b/spec/views/home/_stats.html.haml_spec.rb index 15d637fd2..cc9dba29d 100644 --- a/spec/views/home/_stats.html.haml_spec.rb +++ b/spec/views/home/_stats.html.haml_spec.rb @@ -5,6 +5,6 @@ require 'rails_helper' describe 'home/_stats.html.haml', type: "view" do it 'has activity stats' do render - rendered.should have_content "So far, 0 members have planted 0 crops" + expect(rendered).to have_content "So far, 0 members have planted 0 crops" end end diff --git a/spec/views/home/index_spec.rb b/spec/views/home/index_spec.rb index dcf074168..e3f15de59 100644 --- a/spec/views/home/index_spec.rb +++ b/spec/views/home/index_spec.rb @@ -29,8 +29,8 @@ describe 'home/index.html.haml', type: "view" do end it 'show interesting members' do - rendered.should have_content @member.login_name - rendered.should have_content @member.location + expect(rendered).to have_content @member.login_name + expect(rendered).to have_content @member.location end end end diff --git a/spec/views/layouts/_header_spec.rb b/spec/views/layouts/_header_spec.rb index 0bc3b852c..d71a35537 100644 --- a/spec/views/layouts/_header_spec.rb +++ b/spec/views/layouts/_header_spec.rb @@ -14,24 +14,24 @@ describe 'layouts/_header.html.haml', type: "view" do end it 'has signup/signin links' do - rendered.should have_content 'Sign up' - rendered.should have_content 'Sign in' + expect(rendered).to have_content 'Sign up' + expect(rendered).to have_content 'Sign in' end it 'has a Crops link' do - rendered.should have_content "Crops" + expect(rendered).to have_content "Crops" end it 'has a Seeds link' do - rendered.should have_content "Seeds" + expect(rendered).to have_content "Seeds" end it 'has a Places link' do - rendered.should have_content "Community Map" + expect(rendered).to have_content "Community Map" end it 'has a Community section' do - rendered.should have_content "Community" + expect(rendered).to have_content "Community" end it 'links to members' do @@ -62,7 +62,7 @@ describe 'layouts/_header.html.haml', type: "view" do context "login name" do it 'has member login name' do - rendered.should have_content @member.login_name.to_s + expect(rendered).to have_content @member.login_name.to_s end it "shows link to member's gardens" do @@ -83,19 +83,19 @@ describe 'layouts/_header.html.haml', type: "view" do end it 'shows signout link' do - rendered.should have_content 'Sign out' + expect(rendered).to have_content 'Sign out' end it 'shows inbox link' do - rendered.should have_content 'Inbox' - rendered.should_not match(/Inbox \d+/) + expect(rendered).to have_content 'Inbox' + expect(rendered).not_to match(/Inbox \d+/) end context 'has notifications' do it 'shows inbox count' do create(:notification, recipient: @member) render - rendered.should have_content 'Inbox 1' + expect(rendered).to have_content 'Inbox 1' end end end diff --git a/spec/views/layouts/application_spec.rb b/spec/views/layouts/application_spec.rb index 4ccb69503..81ff77c0c 100644 --- a/spec/views/layouts/application_spec.rb +++ b/spec/views/layouts/application_spec.rb @@ -11,6 +11,6 @@ describe 'layouts/application.html.haml', type: "view" do Rails.application.config.analytics_code = '' render assert_select "script", text: 'console.log("foo!");' - rendered.should_not have_content 'script' + expect(rendered).to have_no_content 'script' end end diff --git a/spec/views/photos/show.html.haml_spec.rb b/spec/views/photos/show.html.haml_spec.rb index 505035493..a68daef34 100644 --- a/spec/views/photos/show.html.haml_spec.rb +++ b/spec/views/photos/show.html.haml_spec.rb @@ -109,7 +109,7 @@ describe "photos/show" do end it "contains the phrase 'All rights reserved'" do - rendered.should have_content "All rights reserved" + expect(rendered).to have_content "All rights reserved" end end end diff --git a/spec/views/places/show.html.haml_spec.rb b/spec/views/places/show.html.haml_spec.rb index a6c35f2b0..0f9a27058 100644 --- a/spec/views/places/show.html.haml_spec.rb +++ b/spec/views/places/show.html.haml_spec.rb @@ -22,7 +22,7 @@ describe "places/show" do it "shows the names of nearby members" do @nearby_members.each do |m| - rendered.should have_content m.login_name + expect(rendered).to have_content m.login_name end end end diff --git a/spec/views/plantings/index.html.haml_spec.rb b/spec/views/plantings/index.html.haml_spec.rb index fe2fd5b23..7bf30fffc 100644 --- a/spec/views/plantings/index.html.haml_spec.rb +++ b/spec/views/plantings/index.html.haml_spec.rb @@ -45,7 +45,7 @@ describe "plantings/index.html.haml" do it "provides data links" do render - rendered.should have_content "The data on this page is available in the following formats:" + expect(rendered).to have_content "The data on this page is available in the following formats:" assert_select "a", href: plantings_path(format: 'csv') assert_select "a", href: plantings_path(format: 'json') assert_select "a", href: plantings_path(format: 'rss') diff --git a/spec/views/posts/_single.html.haml_spec.rb b/spec/views/posts/_single.html.haml_spec.rb index d7a54cd14..f33c33b8b 100644 --- a/spec/views/posts/_single.html.haml_spec.rb +++ b/spec/views/posts/_single.html.haml_spec.rb @@ -54,11 +54,11 @@ describe "posts/_single" do end it "shows edited at" do - rendered.should have_content "edited at" + expect(rendered).to have_content "edited at" end it "shows the updated time" do - rendered.should have_content @post.updated_at.to_fs(:default) + expect(rendered).to have_content @post.updated_at.to_fs(:default) end end @@ -74,11 +74,11 @@ describe "posts/_single" do end it "shows edited at time" do - rendered.should have_content "edited at" + expect(rendered).to have_content "edited at" end it "shows updated time" do - rendered.should have_content @comment.updated_at + expect(rendered).to have_content @comment.updated_at end end @@ -93,7 +93,7 @@ describe "posts/_single" do end it "does not show edited at" do - rendered.should_not have_content "edited at #{@post.updated_at}" + expect(rendered).to have_no_content "edited at #{@post.updated_at}" end end @@ -109,7 +109,7 @@ describe "posts/_single" do end it "does not show edited at" do - rendered.should_not have_content "edited at #{@comment.updated_at}" + expect(rendered).to have_no_content "edited at #{@comment.updated_at}" end end end diff --git a/spec/views/posts/edit.html.haml_spec.rb b/spec/views/posts/edit.html.haml_spec.rb index eeac44986..ec2179c55 100644 --- a/spec/views/posts/edit.html.haml_spec.rb +++ b/spec/views/posts/edit.html.haml_spec.rb @@ -27,7 +27,7 @@ describe "posts/edit" do end it 'no forum mentioned' do - rendered.should_not have_content "This post will be posted in the forum" + expect(rendered).to have_no_content "This post will be posted in the forum" end context "forum specified" do @@ -44,7 +44,7 @@ describe "posts/edit" do end it 'tells the user what forum it will be posted in' do - rendered.should have_content "This post will be posted in the forum #{@forum.name}" + expect(rendered).to have_content "This post will be posted in the forum #{@forum.name}" end end end diff --git a/spec/views/posts/show.rss.haml_spec.rb b/spec/views/posts/show.rss.haml_spec.rb index 5d426cb12..5a4b13271 100644 --- a/spec/views/posts/show.rss.haml_spec.rb +++ b/spec/views/posts/show.rss.haml_spec.rb @@ -14,19 +14,19 @@ describe 'posts/show.rss.haml' do end it 'shows RSS feed title' do - rendered.should have_content "Recent comments on #{@post.subject}" + expect(rendered).to have_content "Recent comments on #{@post.subject}" end it 'shows item title' do - rendered.should have_content "Comment by #{@author.login_name}" + expect(rendered).to have_content "Comment by #{@author.login_name}" end it 'escapes html for link to post' do # it's then unescaped by 'render' so we don't actually look for < - rendered.should have_content '