Setup travis

This commit is contained in:
Brian Quinn 2012-07-20 12:06:56 +01:00
parent b5321443ae
commit b1d01820a6
6 changed files with 13 additions and 40 deletions

11
Gemfile
View File

@ -1,14 +1,3 @@
source 'http://rubygems.org'
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

View File

@ -4,7 +4,7 @@ module Spree
describe CheckoutController do
render_views
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(:order_total) { (order.total * 100).to_i }
let(:gateway_provider) { mock(ActiveMerchant::Billing::PaypalExpressGateway) }

View File

@ -7,5 +7,5 @@ Factory.define(:ppx_order) do |record|
end
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

View File

@ -1,21 +1,18 @@
require 'spec_helper'
feature "Paypal Express checkout" do
background 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
describe "Paypal Express checkout" do
before do
FactoryGirl.create(:shipping_method, :zone => Spree::Zone.find_by_name('North America'))
FactoryGirl.create(:payment_method, :environment => 'test')
@product = FactoryGirl.create(:product, :name => "RoR Mug")
sign_in_as! FactoryGirl.create(:user)
Factory(:ppx)
FactoryGirl.create(:ppx)
end
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)
click_button "Add To Cart"

View File

@ -3,6 +3,7 @@
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../dummy/config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
@ -21,20 +22,10 @@ end
require 'ffaker'
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.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.include Spree::UrlHelpers
end
@ -44,13 +35,3 @@ Spree::Zone.class_eval do
find_by_name("GlobalZone") || Factory(:global_zone)
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

View File

@ -15,4 +15,10 @@ Gem::Specification.new do |s|
s.add_dependency('spree_core', '>=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