This repository has been archived by the owner on Apr 17, 2020. It is now read-only.
forked from DynamoMTL/spree_chimpy
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DynamoMTL#56 from DynamoMTL/feature/calm-current-o…
…rder Chimpy includes ControllerHelpers::Order helper everywhere
- Loading branch information
Showing
5 changed files
with
67 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'spec_helper' | ||
|
||
describe ::Spree::StoreController do | ||
controller(::Spree::StoreController) do | ||
def index | ||
head :ok | ||
end | ||
end | ||
|
||
let(:user) { create(:user) } | ||
subject { controller } | ||
|
||
before do | ||
allow(subject).to receive(:try_spree_current_user).and_return(user) | ||
subject.session[:order_id] = 'R1919' | ||
end | ||
|
||
it 'sets the attributes for order if eid/cid is set in session' do | ||
subject.session[:mc_eid] = '1234' | ||
subject.session[:mc_cid] = 'abcd' | ||
expect(subject).to receive(:find_mail_chimp_params) | ||
|
||
get :index | ||
end | ||
|
||
it 'sets the attributes for the order if eid/cid is set in the params' do | ||
expect(subject).to receive(:find_mail_chimp_params) | ||
|
||
get :index, mc_eid: '1234', mc_cid: 'abcd' | ||
end | ||
|
||
it 'does not call find mail chimp params method if no eid/cid' do | ||
expect(subject).to_not receive(:find_mail_chimp_params) | ||
|
||
get :index | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters