diff --git a/Gemfile b/Gemfile index ef5a4bf3..f9f742c0 100644 --- a/Gemfile +++ b/Gemfile @@ -123,4 +123,6 @@ group :test do gem 'poltergeist' # Set of rails validations matchers to describe models gem 'shoulda' + # Extracted from RSpec 3 stub_model and mock_model + gem 'rspec-activemodel-mocks' end diff --git a/Gemfile.lock b/Gemfile.lock index 597b895c..02a4e990 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -287,6 +287,10 @@ GEM rspec-core (~> 3.0.0) rspec-expectations (~> 3.0.0) rspec-mocks (~> 3.0.0) + rspec-activemodel-mocks (1.0.1) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) rspec-core (3.0.2) rspec-support (~> 3.0.0) rspec-expectations (3.0.2) @@ -420,6 +424,7 @@ DEPENDENCIES rails-observers rdoc-generator-fivefish redcarpet + rspec-activemodel-mocks rspec-rails rubocop sass-rails (>= 4.0.2) diff --git a/spec/views/admin/callforpapers/show.html.haml_spec.rb b/spec/views/admin/callforpapers/show.html.haml_spec.rb index 0584f623..d04551c6 100644 --- a/spec/views/admin/callforpapers/show.html.haml_spec.rb +++ b/spec/views/admin/callforpapers/show.html.haml_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' + describe 'admin/callforpapers/show' do it 'renders callforpapers details' do @@ -8,8 +9,8 @@ describe 'admin/callforpapers/show' do end_date: Date.today + 7.days, description: 'Lorem Ipsum Dolsum') render - expect(rendered).to include("#{Date.today}") - expect(rendered).to include("#{Date.today + 7.days}") + expect(rendered).to include(Date.today.strftime('%Y-%m-%d')) + expect(rendered).to include(7.days.from_now.strftime('%Y-%m-%d')) expect(rendered).to include('Lorem Ipsum Dolsum') end