Skip to content

Commit

Permalink
Fixed broken tests and deprecations after rspec 3.x upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Nov 27, 2014
1 parent 56a2cd2 commit 723c424
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ group :development, :test do
gem 'pg'
end
end

group :test do
gem 'rspec-activemodel-mocks'
end
4 changes: 1 addition & 3 deletions app/controllers/refinery/portfolio/admin/items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ module Admin
class ItemsController < ::Refinery::AdminController
include Refinery::Portfolio

crudify :'refinery/portfolio/item',
:order => 'position ASC',
:xhr_paging => true
crudify :'refinery/portfolio/item', :order => 'position ASC'

before_filter :find_gallery, :only => [:index]

Expand Down
8 changes: 4 additions & 4 deletions app/views/refinery/portfolio/admin/galleries/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<%= render :partial => "refinery/portfolio/admin/shared/locale_picker",
:locals => {
:current_locale => Thread.current[:globalize_locale]
:current_locale => Globalize.locale
} if defined?(::Refinery::I18n) %>

<div class='field'>
<%= f.label :title -%>
<%= f.text_field :title, :class => 'larger widest' -%>
</div>

<div class='field'>
<div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'>
<ul id='page_parts'>
Expand All @@ -38,7 +38,7 @@
</div>
</div>
</div>

<div class='field'>
<span class='label_with_help'>
<%= f.label :parent_id, t('.parent_gallery') -%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/refinery/portfolio/admin/items/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%= render :partial => "refinery/portfolio/admin/shared/locale_picker",
:locals => {
:current_locale => Thread.current[:globalize_locale]
:current_locale => Globalize.locale
} if defined?(::Refinery::I18n) %>

<div class='field'>
Expand Down
2 changes: 1 addition & 1 deletion spec/models/refinery/portfolio/gallery_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module Portfolio
it "invalidates the model" do
subject.save
expect(subject).not_to be_valid
expect(subject.error_on(:title).size).to be >= 1
expect(subject.errors[:title].size).to be >= 1
end
end
end
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def setup_environment

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
Expand Down

0 comments on commit 723c424

Please sign in to comment.