diff --git a/Gemfile b/Gemfile index 00ac1e3..2b7ab95 100644 --- a/Gemfile +++ b/Gemfile @@ -36,6 +36,7 @@ gem "jquery-ui-rails" # To use debugger group :test do gem 'steak' + gem 'rspec-its' gem 'pry-rails' gem 'factory_girl_rails' end diff --git a/Gemfile.lock b/Gemfile.lock index 1a34fe6..6d6cff0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/bterkuile/couch_potato.git - revision: 7712a8d12c319f2e165733800795acbb599638d2 + revision: 6fbcb3edcaf3edec63230308f123c1e03417967d specs: couch_potato (0.7.1) activemodel @@ -9,9 +9,9 @@ GIT GIT remote: git://github.com/bterkuile/devise_simply_stored.git - revision: 8fdaed396a7e9566fe6cb59b64d950953c8506a6 + revision: 86f93782c607958e7f99a6fdbae5566e17047273 specs: - devise_simply_stored (0.1.0) + devise_simply_stored (0.3.0) devise GIT @@ -22,7 +22,7 @@ GIT GIT remote: git://github.com/bterkuile/simply_stored.git - revision: 7e29edef26f6e598c0804ba28929e2fad7045931 + revision: a4b672f68cbcf275aa10fc5014a3763238691956 specs: simply_stored (1.0.0) activesupport @@ -43,27 +43,27 @@ PATH GEM remote: http://rubygems.org/ specs: - actionmailer (4.1.0) - actionpack (= 4.1.0) - actionview (= 4.1.0) + actionmailer (4.1.4) + actionpack (= 4.1.4) + actionview (= 4.1.4) mail (~> 2.5.4) - actionpack (4.1.0) - actionview (= 4.1.0) - activesupport (= 4.1.0) + actionpack (4.1.4) + actionview (= 4.1.4) + activesupport (= 4.1.4) rack (~> 1.5.2) rack-test (~> 0.6.2) - actionview (4.1.0) - activesupport (= 4.1.0) + actionview (4.1.4) + activesupport (= 4.1.4) builder (~> 3.1) erubis (~> 2.7.0) - activemodel (4.1.0) - activesupport (= 4.1.0) + activemodel (4.1.4) + activesupport (= 4.1.4) builder (~> 3.1) - activerecord (4.1.0) - activemodel (= 4.1.0) - activesupport (= 4.1.0) + activerecord (4.1.4) + activemodel (= 4.1.4) + activesupport (= 4.1.4) arel (~> 5.0.0) - activesupport (4.1.0) + activesupport (4.1.4) i18n (~> 0.6, >= 0.6.9) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) @@ -73,11 +73,11 @@ GEM bcrypt (3.1.7) bootstrap-sass (2.3.2.2) sass (~> 3.2) - bourbon (3.2.1) + bourbon (3.2.3) sass (~> 3.2) thor builder (3.2.2) - capybara (2.2.1) + capybara (2.4.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) @@ -108,7 +108,7 @@ GEM activemodel erubis (2.7.0) eventmachine (1.0.3) - execjs (2.0.2) + execjs (2.2.1) factory_girl (4.4.0) activesupport (>= 3.0.0) factory_girl_rails (4.4.1) @@ -123,10 +123,10 @@ GEM railties (>= 4.0.1) hike (1.2.3) i18n (0.6.9) - jquery-rails (3.1.0) + jquery-rails (3.1.1) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (4.2.1) + jquery-ui-rails (5.0.0) railties (>= 3.2.16) json (1.8.1) mail (2.5.4) @@ -134,66 +134,73 @@ GEM treetop (~> 1.4.8) method_source (0.8.2) mime-types (1.25.1) - mini_portile (0.5.3) - minitest (5.3.3) - multi_json (1.9.3) - nokogiri (1.6.1) - mini_portile (~> 0.5.0) + mini_portile (0.6.0) + minitest (5.3.5) + multi_json (1.10.1) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) paperclip (3.5.2) activemodel (>= 3.0.0) activesupport (>= 3.0.0) cocaine (~> 0.5.3) mime-types - polyglot (0.3.4) - pry (0.9.12.6) - coderay (~> 1.0) - method_source (~> 0.8) + polyglot (0.3.5) + pry (0.10.0) + coderay (~> 1.1.0) + method_source (~> 0.8.1) slop (~> 3.4) pry-rails (0.3.2) pry (>= 0.9.10) rack (1.5.2) rack-test (0.6.2) rack (>= 1.0) - rails (4.1.0) - actionmailer (= 4.1.0) - actionpack (= 4.1.0) - actionview (= 4.1.0) - activemodel (= 4.1.0) - activerecord (= 4.1.0) - activesupport (= 4.1.0) + rails (4.1.4) + actionmailer (= 4.1.4) + actionpack (= 4.1.4) + actionview (= 4.1.4) + activemodel (= 4.1.4) + activerecord (= 4.1.4) + activesupport (= 4.1.4) bundler (>= 1.3.0, < 2.0) - railties (= 4.1.0) + railties (= 4.1.4) sprockets-rails (~> 2.0) - railties (4.1.0) - actionpack (= 4.1.0) - activesupport (= 4.1.0) + railties (4.1.4) + actionpack (= 4.1.4) + activesupport (= 4.1.4) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.3.1) + rake (10.3.2) rest-client (1.6.7) mime-types (>= 1.16) - rspec-core (2.14.8) - rspec-expectations (2.14.5) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.6) - rspec-rails (2.14.2) + rspec-core (3.0.2) + rspec-support (~> 3.0.0) + rspec-expectations (3.0.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.0.0) + rspec-its (1.0.1) + rspec-core (>= 2.99.0.beta1) + rspec-expectations (>= 2.99.0.beta1) + rspec-mocks (3.0.2) + rspec-support (~> 3.0.0) + rspec-rails (3.0.1) actionpack (>= 3.0) - activemodel (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-core (~> 2.14.0) - rspec-expectations (~> 2.14.0) - rspec-mocks (~> 2.14.0) + rspec-core (~> 3.0.0) + rspec-expectations (~> 3.0.0) + rspec-mocks (~> 3.0.0) + rspec-support (~> 3.0.0) + rspec-support (3.0.2) sass (3.2.19) sass-rails (4.0.3) railties (>= 4.0.0, < 5.0) sass (~> 3.2.0) sprockets (~> 2.8, <= 2.11.0) sprockets-rails (~> 2.0) - slim (2.0.2) + slim (2.0.3) temple (~> 0.6.6) tilt (>= 1.3.3, < 2.1) - slim-rails (2.1.4) + slim-rails (2.1.5) actionpack (>= 3.0, < 4.2) activesupport (>= 3.0, < 4.2) railties (>= 3.0, < 4.2) @@ -211,20 +218,20 @@ GEM steak (2.0.0) capybara (>= 1.0.0) rspec-rails (>= 2.5.0) - temple (0.6.7) + temple (0.6.8) thin (1.6.2) daemons (>= 1.0.9) eventmachine (>= 1.0.0) rack (>= 1.0.0) thor (0.19.1) - thread_safe (0.3.3) + thread_safe (0.3.4) tilt (1.4.1) - tinymce-rails (4.0.19) + tinymce-rails (4.1.0) railties (>= 3.1.1) treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (1.1.0) + tzinfo (1.2.1) thread_safe (~> 0.1) warden (1.2.3) rack (>= 1.0) @@ -251,6 +258,7 @@ DEPENDENCIES paperclip (= 3.5.2) pry-rails rails (>= 4.1.0) + rspec-its sass-rails simply_stored! slim-rails diff --git a/app/assets/javascripts/cmtool/application.js b/app/assets/javascripts/cmtool/application.js index 1d6ef76..a2ce2e1 100644 --- a/app/assets/javascripts/cmtool/application.js +++ b/app/assets/javascripts/cmtool/application.js @@ -12,7 +12,7 @@ // //= require jquery //= require jquery_ujs -//= require jquery.ui.all +//= require jquery-ui //= require bootstrap //= require tinymce-jquery //= require_directory . diff --git a/spec/cmtool_menu_spec.rb b/spec/cmtool_menu_spec.rb index c38ffcb..3e69951 100644 --- a/spec/cmtool_menu_spec.rb +++ b/spec/cmtool_menu_spec.rb @@ -13,21 +13,21 @@ describe Cmtool::Menu do base_element = Cmtool::Menu::ElementBase.new element_names = Cmtool::Menu::ElementBase.subclasses.map{|e| e.name.sub(/.*::/, '').underscore } for element_name in element_names - base_element.send("#{element_name}?").should be_false + base_element.send("#{element_name}?").should be false end end end describe Cmtool::Menu::Group do it "should identify itself as such" do - Cmtool::Menu::Group.new.group?.should be_true + Cmtool::Menu::Group.new.group?.should be true end it "should not identify as resource link" do - Cmtool::Menu::Group.new.resource_link?.should be_false + Cmtool::Menu::Group.new.resource_link?.should be false end end describe Cmtool::Menu::ResourceLink do it "should identify itself as such" do - Cmtool::Menu::ResourceLink.new(User).resource_link?.should be_true + Cmtool::Menu::ResourceLink.new(User).resource_link?.should be true end end describe :items do @@ -105,10 +105,10 @@ describe Cmtool::Menu do end end it 'Should add a engine link' do - Cmtool::Menu.items.last.engine_link?.should be_true + Cmtool::Menu.items.last.engine_link?.should be true end it 'Should not identify as a resource link' do - Cmtool::Menu.items.last.resource_link?.should be_false + Cmtool::Menu.items.last.resource_link?.should be false end it 'should set the path when given as symbol' do diff --git a/spec/controllers/contact_forms_controller_spec.rb b/spec/controllers/contact_forms_controller_spec.rb index 974c927..dcbdff7 100644 --- a/spec/controllers/contact_forms_controller_spec.rb +++ b/spec/controllers/contact_forms_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Cmtool::ContactFormsController do +describe Cmtool::ContactFormsController, type: :controller do routes { Cmtool::Engine.routes } before :each do sign_in @user diff --git a/spec/controllers/faqs_controller_spec.rb b/spec/controllers/faqs_controller_spec.rb index e179722..8f7d881 100644 --- a/spec/controllers/faqs_controller_spec.rb +++ b/spec/controllers/faqs_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Cmtool::FaqsController do +describe Cmtool::FaqsController, type: :controller do routes { Cmtool::Engine.routes } before :each do sign_in @user diff --git a/spec/controllers/newsletter_subscriptions_controller_spec.rb b/spec/controllers/newsletter_subscriptions_controller_spec.rb index 4be1127..6124b38 100644 --- a/spec/controllers/newsletter_subscriptions_controller_spec.rb +++ b/spec/controllers/newsletter_subscriptions_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Cmtool::NewsletterSubscriptionsController do +describe Cmtool::NewsletterSubscriptionsController, type: :controller do routes { Cmtool::Engine.routes } before :each do sign_in @user diff --git a/spec/controllers/pages_controller_spec.rb b/spec/controllers/pages_controller_spec.rb index 1b388ce..accbfa7 100644 --- a/spec/controllers/pages_controller_spec.rb +++ b/spec/controllers/pages_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Cmtool::PagesController do +describe Cmtool::PagesController, type: :controller do routes { Cmtool::Engine.routes } describe 'GET index' do it "should render standard view when tree is available" do diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb index 9eb318d..ce28609 100644 --- a/spec/models/page_spec.rb +++ b/spec/models/page_spec.rb @@ -14,7 +14,7 @@ describe Page do it "should not be valid when the parent has a different locale then the page itself" do @nl12.parent_id = @en1.id @nl12.should_not be_valid - @nl12.error_on(:locale).should_not be_empty + @nl12.errors[:locale].should_not be_empty end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index af2fe8f..50e6db8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -22,7 +22,7 @@ RSpec.configure do |config| #config.application = Cmtool::Engine #config.include CompanyFactory config.include Cmtool::Engine.routes.url_helpers - config.include Devise::TestHelpers, :type => :controller + config.include Devise::TestHelpers, type: :controller #config.use_transactional_fixtures = true config.infer_base_class_for_anonymous_controllers = true config.render_views = true