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.
- Loading branch information
1 parent
a1b0d43
commit 5ea6ffa
Showing
22 changed files
with
131 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ spec/dummy | |
.bundle | ||
.node-version | ||
.ruby-version | ||
gemfiles/*.lock |
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,25 @@ | ||
sudo: required | ||
dist: trusty | ||
|
||
script: | ||
- bundle exec rake test_app | ||
- bundle exec rake spec | ||
|
||
env: | ||
- DB=mysql | ||
- DB=postgres | ||
|
||
language: ruby | ||
|
||
rvm: | ||
- 2.3.1 | ||
- 2.2.7 | ||
|
||
gemfile: | ||
- gemfiles/spree_3_1.gemfile | ||
- gemfiles/spree_3_2.gemfile | ||
- gemfiles/spree_3_3.gemfile | ||
- gemfiles/spree_master.gemfile | ||
|
||
before_install: | ||
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';" |
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,23 @@ | ||
appraise 'spree-3-1' do | ||
gem 'spree', '~> 3.1.0' | ||
gem 'spree_auth_devise', '~> 3.1.0' | ||
gem 'rails_test_params_backport', group: :test | ||
end | ||
|
||
appraise 'spree-3-2' do | ||
gem 'spree', '~> 3.2.0' | ||
gem 'spree_auth_devise', '~> 3.2.0' | ||
gem 'rails-controller-testing' | ||
end | ||
|
||
appraise 'spree-3-3' do | ||
gem 'spree', '~> 3.3.0' | ||
gem 'spree_auth_devise', '~> 3.3.0' | ||
gem 'rails-controller-testing' | ||
end | ||
|
||
appraise 'spree-master' do | ||
gem 'spree', github: 'spree/spree', branch: 'master' | ||
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master' | ||
gem 'rails-controller-testing' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'spree', github: 'spree/spree', branch: '2-3-stable' | ||
gem 'spree_auth_devise', github: "spree/spree_auth_devise", branch: '2-3-stable' | ||
gem 'libnotify' | ||
gem 'fuubar' | ||
gem 'byebug' | ||
gem 'pry-byebug' | ||
gem 'spree', github: 'spree/spree', branch: 'master' | ||
gem 'rails-controller-testing' | ||
|
||
gemspec |
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
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,9 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "spree", "~> 3.1.0" | ||
gem "spree_auth_devise", "~> 3.1.0" | ||
gem "rails_test_params_backport", group: :test | ||
|
||
gemspec path: "../" |
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,9 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "spree", "~> 3.2.0" | ||
gem "rails-controller-testing" | ||
gem "spree_auth_devise", "~> 3.2.0" | ||
|
||
gemspec path: "../" |
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,9 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "spree", "~> 3.3.0" | ||
gem "rails-controller-testing" | ||
gem "spree_auth_devise", "~> 3.3.0" | ||
|
||
gemspec path: "../" |
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,9 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "spree", github: "spree/spree", branch: "master" | ||
gem "rails-controller-testing" | ||
gem "spree_auth_devise", github: "spree/spree_auth_devise", branch: "master" | ||
|
||
gemspec path: "../" |
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
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
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 |
---|---|---|
@@ -1,21 +1,20 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Subscribers' do | ||
|
||
context 'with valid subscription' do | ||
it 'redirects to referer' do | ||
post '/subscribers', | ||
{ chimpy_subscriber: { email: '[email protected]', subscribed: true } }, | ||
{ referer: 'http://foo.bar' } | ||
post '/subscribers', params: { | ||
chimpy_subscriber: { email: '[email protected]', subscribed: true } }, | ||
headers: { referer: 'http://foo.bar' } | ||
|
||
expect(response).to be_redirect | ||
expect(response.location).to eq('http://foo.bar') | ||
end | ||
|
||
it 'redirects to root URL if no referer' do | ||
post '/subscribers', | ||
{ chimpy_subscriber: { email: '[email protected]', subscribed: true } }, | ||
{ referer: nil } | ||
params: { chimpy_subscriber: { email: '[email protected]', subscribed: true } }, | ||
headers: { referer: nil } | ||
|
||
expect(response).to be_redirect | ||
expect(response.location).to eq('http://www.example.com/') | ||
|
@@ -24,11 +23,11 @@ | |
|
||
context 'with json response' do | ||
it 'returns 200 with json data' do | ||
post '/subscribers', format: :json, chimpy_subscriber: { email: '[email protected]', subscribed: true } | ||
post '/subscribers', params: { format: :json, chimpy_subscriber: { email: '[email protected]', subscribed: true } } | ||
|
||
expect(response).to be_success | ||
json_response = JSON.parse(response.body) | ||
expect(json_response['email']).to eq('[email protected]') | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
require 'spree/testing_support/factories' | ||
require 'spree/testing_support/url_helpers' | ||
require 'spree/testing_support/controller_requests' | ||
require 'spree/testing_support/authorization_helpers' | ||
require 'spree/testing_support/url_helpers' | ||
require 'spree/testing_support/capybara_ext' | ||
|
||
RSpec.configure do |config| | ||
config.include Spree::TestingSupport::UrlHelpers | ||
config.include Spree::TestingSupport::ControllerRequests | ||
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