Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support spree 3-1-stable and Spree.user_class #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

# Provides basic authentication functionality for testing parts of your engine
version = '3-0-stable'
version = '3-1-stable'
gem 'spree', github: 'spree/spree', branch: version
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: version

Expand Down
2 changes: 1 addition & 1 deletion app/models/spree/user_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Spree::User.class_eval do
Spree.user_class.class_eval do
has_many :payments, through: :orders
end
2 changes: 1 addition & 1 deletion spec/controllers/spree/admin/banks_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let(:roles) { [role] }

before(:each) do
@user = mock_model(Spree::User, :generate_spree_api_key! => false)
@user = mock_model(Spree.user_class, :generate_spree_api_key! => false)
allow(@user).to receive_message_chain(:roles, :includes).and_return([])
allow(@user).to receive(:has_spree_role?).with('admin').and_return(true)
allow(controller).to receive(:spree_user_signed_in?).and_return(true)
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/spree/content_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe Spree::ContentController, type: :controller do
before do
allow(controller).to receive(:authenticate_spree_user!).and_return(true)
@user = mock_model(Spree::User, :generate_spree_api_key! => false, last_incomplete_spree_order: nil)
@user = mock_model(Spree.user_class, :generate_spree_api_key! => false, last_incomplete_spree_order: nil)
allow(controller).to receive(:spree_current_user).and_return(@user)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/spree/payments_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe Spree::PaymentsController, type: :controller do
before do
allow(controller).to receive(:authenticate_spree_user!).and_return(true)
@user = mock_model(Spree::User, :generate_spree_api_key! => false, last_incomplete_spree_order: nil)
@user = mock_model(Spree.user_class, :generate_spree_api_key! => false, last_incomplete_spree_order: nil)
allow(controller).to receive(:spree_current_user).and_return(@user)

@payment = mock_model(Spree::Payment)
Expand Down
2 changes: 1 addition & 1 deletion spec/models/spree/user_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'spec_helper'

describe Spree::User, type: :model do
describe Spree.user_class, type: :model do
it { is_expected.to have_many(:payments).through(:orders) }
end
4 changes: 2 additions & 2 deletions spree_bank_transfer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree-bank-transfer'
s.version = '3.0.0'
s.version = '3.1.0'
s.summary = 'Spree extension to create bank transfer payment method.'
s.description = 'This Spree extension allows admin to provide bank transfer payment method to its users.'
s.required_ruby_version = '>= 1.9.3'
Expand All @@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.require_path = 'lib'
s.requirements << 'none'

s.add_dependency 'spree_core', '~> 3.0.0'
s.add_dependency 'spree_core', '~> 3.1.0.beta'
s.add_dependency 'sqlite3', '~> 1.3.10'
s.add_development_dependency 'mysql2'
s.add_development_dependency 'pg'
Expand Down