Skip to content

Commit

Permalink
add activemodel-mocks and patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jspizziri committed Apr 2, 2015
1 parent d17112c commit 77a302a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ group :development, :test do
gem 'ffaker'
gem 'rails', '~> 4.2.0'
gem 'rspec-rails', '~> 2.13'
gem 'rspec-activemodel-mocks'
end

gemspec
8 changes: 8 additions & 0 deletions spec/support/rspec-activemodel-mocks_patch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Manually applied the patch from https://github.com/jdelStrother/rspec-activemodel-mocks/commit/1211c347c5a574739616ccadf4b3b54686f9051f
if Gem.loaded_specs['rspec-activemodel-mocks'].version.to_s != "1.0.1"
raise "RSpec-ActiveModel-Mocks version has changed, please check if the behaviour has already been fixed: https://github.com/rspec/rspec-activemodel-mocks/pull/10
If so, this patch might be obsolete-"
end
RSpec::ActiveModel::Mocks::Mocks::ActiveRecordInstanceMethods.class_eval do
alias_method :_read_attribute, :[]
end

0 comments on commit 77a302a

Please sign in to comment.