diff --git a/Gemfile b/Gemfile index ae47e80..e3c9a17 100644 --- a/Gemfile +++ b/Gemfile @@ -2,14 +2,14 @@ source "http://rubygems.org" gemspec -gem 'refinerycms', github: 'refinery/refinerycms' -gem 'refinerycms-i18n', github: 'refinery/refinerycms-i18n' +gem 'refinerycms', git: 'https://github.com/refinery/refinerycms' +gem 'refinerycms-i18n', git: 'https://github.com/refinery/refinerycms-i18n' gem 'refinerycms-wymeditor', '~> 1.0.0' gem "mime-types", "~> 1.25" group :test do - gem 'refinerycms-testing', github: 'refinery/refinerycms' + gem 'refinerycms-testing', git: 'https://github.com/refinery/refinerycms' gem 'poltergeist' end diff --git a/spec/features/admin/page_images_spec.rb b/spec/features/admin/page_images_spec.rb index 3843d7e..3a6c2f4 100644 --- a/spec/features/admin/page_images_spec.rb +++ b/spec/features/admin/page_images_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe "page images" do +describe "page images", :type => :feature do refinery_login_with :refinery_user let(:configure) {} @@ -21,26 +21,26 @@ image setup_and_visit - page_for_images.images.count.should eq 0 + expect(page_for_images.images.count).to eq 0 page.find("#{page_images_tab_id} a").click # Add the first Image click_link "Add Image" - page.should have_selector 'iframe#dialog_iframe' + expect(page).to have_selector 'iframe#dialog_iframe' page.within_frame('dialog_iframe') do find(:css, "#existing_image_area img#image_#{image.id}").click click_button ::I18n.t('button_text', :scope => 'refinery.admin.images.existing_image') end # image should be visable on the page - page.should have_selector("#page_images li#image_#{image.id}") + expect(page).to have_selector("#page_images li#image_#{image.id}") click_button "Save" # image should be in the db - page_for_images.images.count.should eq 1 + expect(page_for_images.images.count).to eq 1 end @@ -53,21 +53,21 @@ setup_and_visit - page_for_images.images.count.should eq 1 + expect(page_for_images.images.count).to eq 1 page.find("#{page_images_tab_id} a").click - page.should have_selector("#page_images li#image_#{page_for_images.images.first.id}") + expect(page).to have_selector("#page_images li#image_#{page_for_images.images.first.id}") image_li_tag = page.find("#page_images li:first-child") image_li_tag.hover within(image_li_tag) { page.find('img:first-child').click } - page.should_not have_selector("#page_images li#image_#{page_for_images.images.first.id}") + expect(page).not_to have_selector("#page_images li#image_#{page_for_images.images.first.id}") click_button "Save" - page_for_images.images.count.should eq 0 + expect(page_for_images.images.count).to eq 0 end end diff --git a/spec/features/attach_page_images_spec.rb b/spec/features/attach_page_images_spec.rb index b91d04b..cc5e2f1 100644 --- a/spec/features/attach_page_images_spec.rb +++ b/spec/features/attach_page_images_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe "attach page images" do +describe "attach page images", :type => :feature do refinery_login_with :refinery_user # No-op block : use default configuration by default @@ -19,7 +19,7 @@ it "shows images tab" do setup_and_visit within page_images_tab_id do - page.should have_content("Images") + expect(page).to have_content("Images") end end @@ -31,7 +31,7 @@ click_link "Images" end - page.should have_content("Add Image") + expect(page).to have_content("Add Image") end context "with caption and WYSIWYG disabled" do @@ -51,7 +51,7 @@ image_li_tag.hover within(image_li_tag) { page.find('img.caption').click } - page.find('.ui-dialog textarea').should be_visible + expect(page.find('.ui-dialog textarea')).to be_visible end end diff --git a/spec/lib/refinery/initializer_spec.rb b/spec/lib/refinery/initializer_spec.rb index 2e1c13e..8c23aa3 100644 --- a/spec/lib/refinery/initializer_spec.rb +++ b/spec/lib/refinery/initializer_spec.rb @@ -13,7 +13,7 @@ class Tab; end end before(:each) do - Refinery::PageImages.config.stub(:enable_for).and_return(enable_for_config) + allow(Refinery::PageImages.config).to receive(:enable_for).and_return(enable_for_config) end def enable_for_config @@ -23,18 +23,18 @@ def enable_for_config describe "attach initializer" do it "calls attach on all configured model" do - Refinery::PageImages.config.stub(:enable_for).and_return(enable_for_config) + allow(Refinery::PageImages.config).to receive(:enable_for).and_return(enable_for_config) - Refinery::PageImages::EnableForMock::Model.should_receive(:has_many_page_images).once - Refinery::Page.should_not_receive(:has_many_page_images) + expect(Refinery::PageImages::EnableForMock::Model).to receive(:has_many_page_images).once + expect(Refinery::Page).not_to receive(:has_many_page_images) ActionDispatch::Reloader.prepare! end end describe "attach_initialize_tabs!" do it "registers tabs for all configured engine" do - Refinery::PageImages::EnableForMock::Tab.should_receive(:register).once - Refinery::Pages::Tab.should_not_receive(:register) + expect(Refinery::PageImages::EnableForMock::Tab).to receive(:register).once + expect(Refinery::Pages::Tab).not_to receive(:register) Refinery::PageImages::Engine.initialize_tabs! end end diff --git a/spec/models/refinery/blog_spec.rb b/spec/models/refinery/blog_spec.rb index babceeb..d926a20 100644 --- a/spec/models/refinery/blog_spec.rb +++ b/spec/models/refinery/blog_spec.rb @@ -5,12 +5,12 @@ module Blog describe Post, type: :model do it "should not have images" do blog = FactoryGirl.create(:blog_post) - blog.images.count.should == 0 + expect(blog.images.count).to eq(0) end it "should have images" do blog = FactoryGirl.create(:blog_post_with_image) - blog.images.count.should == 1 + expect(blog.images.count).to eq(1) end end end diff --git a/spec/models/refinery/page_spec.rb b/spec/models/refinery/page_spec.rb index 31e7759..9b34fb1 100644 --- a/spec/models/refinery/page_spec.rb +++ b/spec/models/refinery/page_spec.rb @@ -17,11 +17,11 @@ module Refinery end it 'returns an image and a caption' do - page.images_with_captions.count.should eq(0) + expect(page.images_with_captions.count).to eq(0) page.image_pages.create(image: FactoryGirl.build(:image)) - page.images_with_captions.first[:image].should be_a(Refinery::Image) - page.images_with_captions.first[:caption].should be_a(String) + expect(page.images_with_captions.first[:image]).to be_a(Refinery::Image) + expect(page.images_with_captions.first[:caption]).to be_a(String) end end @@ -53,13 +53,13 @@ module Refinery }, }) - page.images.should eq([images.first]) + expect(page.images).to eq([images.first]) end it "deletes all images" do page.update_attributes(:images_attributes => {"0" => {"id"=>""}}) - page.images.should be_empty + expect(page.images).to be_empty end it "reorders images" do @@ -81,7 +81,7 @@ module Refinery }, }) - page.images.should eq([images.second, images.first]) + expect(page.images).to eq([images.second, images.first]) end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bc10eff..9fb12f9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,7 +13,6 @@ RSpec.configure do |config| config.mock_with :rspec - config.treat_symbols_as_metadata_keys_with_true_values = true config.filter_run :focus => true config.run_all_when_everything_filtered = true end