diff options
author | Philip Arndt <git@arndt.io> | 2014-12-05 11:53:18 -0800 |
---|---|---|
committer | Philip Arndt <git@arndt.io> | 2014-12-05 11:53:18 -0800 |
commit | 50c4b236da7120674589c254b05f8e78f7d7e8b4 (patch) | |
tree | e696de404d22f38f03a767c6376d7198e433fbca /spec/helpers | |
parent | 1cec6e540daa2a5971290dc33bae77ed35f5429a (diff) | |
parent | c5d248b280ca975579d3a09ae8b7253afa2b0752 (diff) | |
download | refinerycms-blog-50c4b236da7120674589c254b05f8e78f7d7e8b4.tar.gz refinerycms-blog-50c4b236da7120674589c254b05f8e78f7d7e8b4.tar.bz2 refinerycms-blog-50c4b236da7120674589c254b05f8e78f7d7e8b4.zip |
Merge pull request #402 from refinery/rspec-3-x
Rspec 3 x
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/refinery/blog/posts_helper_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/helpers/refinery/blog/posts_helper_spec.rb b/spec/helpers/refinery/blog/posts_helper_spec.rb index 4a791d9..4e19999 100644 --- a/spec/helpers/refinery/blog/posts_helper_spec.rb +++ b/spec/helpers/refinery/blog/posts_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' module Refinery module Blog - describe PostsHelper do + describe PostsHelper, :type => :helper do describe "#blog_archive_widget", type: :helper do let(:html) { helper.blog_archive_widget(dates) } let(:links) { Capybara.string(html).find("#blog_archive_widget ul") } @@ -11,7 +11,7 @@ module Refinery let(:dates) { [] } it "does not display anything" do - html.should be_blank + expect(html).to be_blank end end @@ -29,18 +29,18 @@ module Refinery month = Date::MONTHNAMES[recent_post.month] year = recent_post.year - links.should have_link("#{month} #{year} (3)") + expect(links).to have_link("#{month} #{year} (3)") end it "has a link for the year of dates older than one year" do year = old_post.year - links.should have_link("#{year} (3)") + expect(links).to have_link("#{year} (3)") end it "sorts recent links before old links" do - links.find("li:first").should have_content(recent_post.year.to_s) - links.find("li:last").should have_content(old_post.year.to_s) + expect(links.find("li:first")).to have_content(recent_post.year.to_s) + expect(links.find("li:last")).to have_content(old_post.year.to_s) end end @@ -50,8 +50,8 @@ module Refinery it "sorts by the more recent date" do first, second = dates.map {|p| Date::MONTHNAMES[p.month] } - links.find("li:first").should have_content(second) - links.find("li:last").should have_content(first) + expect(links.find("li:first")).to have_content(second) + expect(links.find("li:last")).to have_content(first) end end @@ -61,8 +61,8 @@ module Refinery it "sorts by the more recent date" do first, second = dates.map {|p| p.year.to_s } - links.find("li:first").should have_content(second) - links.find("li:last").should have_content(first) + expect(links.find("li:first")).to have_content(second) + expect(links.find("li:last")).to have_content(first) end end end @@ -71,11 +71,11 @@ module Refinery let(:email) { "test@test.com" } it "returns gravatar url" do - helper.avatar_url(email).should eq("http://gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=60.jpg") + expect(helper.avatar_url(email)).to eq("http://gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=60.jpg") end it "accepts options hash to change default size" do - helper.avatar_url(email, :size => 55).should eq("http://gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=55.jpg") + expect(helper.avatar_url(email, :size => 55)).to eq("http://gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=55.jpg") end end end |