Setup travis
This commit is contained in:
parent
b5321443ae
commit
b1d01820a6
11
Gemfile
11
Gemfile
|
@ -1,14 +1,3 @@
|
||||||
source 'http://rubygems.org'
|
source 'http://rubygems.org'
|
||||||
|
|
||||||
gemspec
|
gemspec
|
||||||
|
|
||||||
gem 'sqlite3'
|
|
||||||
gem 'spree', '1.1.2'
|
|
||||||
|
|
||||||
group :test do
|
|
||||||
gem 'rspec-rails', '= 2.7.0'
|
|
||||||
gem 'factory_girl_rails', '= 1.3.0'
|
|
||||||
gem 'simplecov'
|
|
||||||
gem 'shoulda'
|
|
||||||
gem 'faker'
|
|
||||||
end
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Spree
|
||||||
describe CheckoutController do
|
describe CheckoutController do
|
||||||
render_views
|
render_views
|
||||||
let(:token) { "EC-2OPN7UJGFWK9OYFV" }
|
let(:token) { "EC-2OPN7UJGFWK9OYFV" }
|
||||||
let(:order) { Factory(:ppx_order_with_totals, :state => "payment", :shipping_method => shipping_method) }
|
let(:order) { FactoryGirl.create(:ppx_order_with_totals, :state => "payment", :shipping_method => shipping_method) }
|
||||||
let(:shipping_method) { FactoryGirl.create(:shipping_method, :zone => Spree::Zone.find_by_name('North America')) }
|
let(:shipping_method) { FactoryGirl.create(:shipping_method, :zone => Spree::Zone.find_by_name('North America')) }
|
||||||
let(:order_total) { (order.total * 100).to_i }
|
let(:order_total) { (order.total * 100).to_i }
|
||||||
let(:gateway_provider) { mock(ActiveMerchant::Billing::PaypalExpressGateway) }
|
let(:gateway_provider) { mock(ActiveMerchant::Billing::PaypalExpressGateway) }
|
||||||
|
|
|
@ -7,5 +7,5 @@ Factory.define(:ppx_order) do |record|
|
||||||
end
|
end
|
||||||
|
|
||||||
Factory.define :ppx_order_with_totals, :parent => :order do |f|
|
Factory.define :ppx_order_with_totals, :parent => :order do |f|
|
||||||
f.after_create { |order| Factory(:line_item, :order => order, :price => 10) and order.line_items.reload }
|
f.after_create { |order| FactoryGirl.create(:line_item, :order => order, :price => 10) and order.line_items.reload }
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature "Paypal Express checkout" do
|
describe "Paypal Express checkout" do
|
||||||
background do
|
before do
|
||||||
# PAYMENT_STATES = Spree::Payment.state_machine.states.keys unless defined? PAYMENT_STATES
|
|
||||||
# SHIPMENT_STATES = Spree::Shipment.state_machine.states.keys unless defined? SHIPMENT_STATES
|
|
||||||
# ORDER_STATES = Spree::Order.state_machine.states.keys unless defined? ORDER_STATES
|
|
||||||
FactoryGirl.create(:shipping_method, :zone => Spree::Zone.find_by_name('North America'))
|
FactoryGirl.create(:shipping_method, :zone => Spree::Zone.find_by_name('North America'))
|
||||||
FactoryGirl.create(:payment_method, :environment => 'test')
|
FactoryGirl.create(:payment_method, :environment => 'test')
|
||||||
@product = FactoryGirl.create(:product, :name => "RoR Mug")
|
@product = FactoryGirl.create(:product, :name => "RoR Mug")
|
||||||
sign_in_as! FactoryGirl.create(:user)
|
sign_in_as! FactoryGirl.create(:user)
|
||||||
|
|
||||||
Factory(:ppx)
|
FactoryGirl.create(:ppx)
|
||||||
end
|
end
|
||||||
|
|
||||||
let!(:address) { FactoryGirl.create(:address, :state => Spree::State.first) }
|
let!(:address) { FactoryGirl.create(:address, :state => Spree::State.first) }
|
||||||
|
|
||||||
scenario "should display paypal link", :js => true do
|
it "should display paypal link", :js => true do
|
||||||
visit spree.product_path(@product)
|
visit spree.product_path(@product)
|
||||||
|
|
||||||
click_button "Add To Cart"
|
click_button "Add To Cart"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
ENV["RAILS_ENV"] ||= 'test'
|
ENV["RAILS_ENV"] ||= 'test'
|
||||||
require File.expand_path("../dummy/config/environment", __FILE__)
|
require File.expand_path("../dummy/config/environment", __FILE__)
|
||||||
require 'rspec/rails'
|
require 'rspec/rails'
|
||||||
|
require 'capybara/rspec'
|
||||||
|
|
||||||
# Requires supporting ruby files with custom matchers and macros, etc,
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
||||||
# in spec/support/ and its subdirectories.
|
# in spec/support/ and its subdirectories.
|
||||||
|
@ -21,20 +22,10 @@ end
|
||||||
require 'ffaker'
|
require 'ffaker'
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
# == Mock Framework
|
|
||||||
#
|
|
||||||
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
|
||||||
#
|
|
||||||
# config.mock_with :mocha
|
|
||||||
# config.mock_with :flexmock
|
|
||||||
# config.mock_with :rr
|
|
||||||
config.mock_with :rspec
|
config.mock_with :rspec
|
||||||
|
|
||||||
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
||||||
|
|
||||||
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
||||||
# examples within a transaction, comment the following line or assign false
|
|
||||||
# instead of true.
|
|
||||||
config.use_transactional_fixtures = true
|
config.use_transactional_fixtures = true
|
||||||
config.include Spree::UrlHelpers
|
config.include Spree::UrlHelpers
|
||||||
end
|
end
|
||||||
|
@ -44,13 +35,3 @@ Spree::Zone.class_eval do
|
||||||
find_by_name("GlobalZone") || Factory(:global_zone)
|
find_by_name("GlobalZone") || Factory(:global_zone)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# class ActionController::TestCase
|
|
||||||
# module Behavior
|
|
||||||
# def process_with_default_host(action, parameters = nil, session = nil, flash = nil, http_method = 'GET')
|
|
||||||
# parameters = { :host => 'example.com' }.merge( parameters || {} )
|
|
||||||
# process_without_default_host(action, parameters, session, flash, http_method)
|
|
||||||
# end
|
|
||||||
# alias_method_chain :process, :default_host
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
|
@ -15,4 +15,10 @@ Gem::Specification.new do |s|
|
||||||
|
|
||||||
s.add_dependency('spree_core', '>=1.0.0')
|
s.add_dependency('spree_core', '>=1.0.0')
|
||||||
s.add_dependency('spree_auth', '>=1.0.0')
|
s.add_dependency('spree_auth', '>=1.0.0')
|
||||||
|
|
||||||
|
s.add_development_dependency 'capybara', '1.1.2'
|
||||||
|
s.add_development_dependency 'factory_girl', '~> 3.5.0'
|
||||||
|
s.add_development_dependency 'ffaker'
|
||||||
|
s.add_development_dependency 'rspec-rails', '~> 2.11.0'
|
||||||
|
s.add_development_dependency 'sqlite3'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue