Permalink
Browse files

testing

  • Loading branch information...
1 parent 800c75e commit e00c671d287cf150c72009b561197390a24e93d0 cmar committed Oct 26, 2011
View
@@ -5,3 +5,4 @@ tmp
.sass-cache/
.rvmrc
.DS_Store
+spec/dummy
View
@@ -0,0 +1,6 @@
+gemspec
+
+group :test, :development do
+ gem 'sqlite3'
+ gem 'rspec-rails'
+end
View
@@ -0,0 +1,170 @@
+PATH
+ remote: .
+ specs:
+ spree_analytics (0.1.0)
+ rest-client
+ spree_core (>= 0.60.2)
+
+GEM
+ specs:
+ actionmailer (3.1.1)
+ actionpack (= 3.1.1)
+ mail (~> 2.3.0)
+ actionpack (3.1.1)
+ activemodel (= 3.1.1)
+ activesupport (= 3.1.1)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6)
+ rack (~> 1.3.2)
+ rack-cache (~> 1.1)
+ rack-mount (~> 0.8.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.0.2)
+ activemerchant (1.17.0)
+ activesupport (>= 2.3.11)
+ braintree (>= 2.0.0)
+ builder (>= 2.0.0)
+ json (>= 1.5.1)
+ activemodel (3.1.1)
+ activesupport (= 3.1.1)
+ builder (~> 3.0.0)
+ i18n (~> 0.6)
+ activerecord (3.1.1)
+ activemodel (= 3.1.1)
+ activesupport (= 3.1.1)
+ arel (~> 2.2.1)
+ tzinfo (~> 0.3.29)
+ activeresource (3.1.1)
+ activemodel (= 3.1.1)
+ activesupport (= 3.1.1)
+ activesupport (3.1.1)
+ multi_json (~> 1.0)
+ acts_as_list (0.1.4)
+ arel (2.2.1)
+ braintree (2.12.0)
+ builder (>= 2.0.0)
+ builder (3.0.0)
+ cocaine (0.2.0)
+ deface (0.7.0)
+ nokogiri (~> 1.5.0)
+ rails (>= 3.0.9)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
+ faker (1.0.0)
+ i18n (~> 0.4)
+ highline (1.5.1)
+ hike (1.2.1)
+ i18n (0.6.0)
+ jquery-rails (1.0.16)
+ railties (~> 3.0)
+ thor (~> 0.14)
+ json (1.6.1)
+ kaminari (0.12.4)
+ rails (>= 3.0.0)
+ mail (2.3.0)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ meta_search (1.1.1)
+ actionpack (~> 3.1.0)
+ activerecord (~> 3.1.0)
+ activesupport (~> 3.1.0)
+ polyamorous (~> 0.5.0)
+ mime-types (1.16)
+ multi_json (1.0.3)
+ nested_set (1.6.8)
+ activerecord (>= 3.0.0)
+ railties (>= 3.0.0)
+ nokogiri (1.5.0)
+ paperclip (2.4.1)
+ activerecord (>= 2.3.0)
+ activesupport (>= 2.3.2)
+ cocaine (>= 0.0.2)
+ mime-types
+ polyamorous (0.5.0)
+ activerecord (~> 3.0)
+ polyglot (0.3.2)
+ rack (1.3.5)
+ rack-cache (1.1)
+ rack (>= 0.4)
+ rack-mount (0.8.3)
+ rack (>= 1.0.0)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.1.1)
+ actionmailer (= 3.1.1)
+ actionpack (= 3.1.1)
+ activerecord (= 3.1.1)
+ activeresource (= 3.1.1)
+ activesupport (= 3.1.1)
+ bundler (~> 1.0)
+ railties (= 3.1.1)
+ railties (3.1.1)
+ actionpack (= 3.1.1)
+ activesupport (= 3.1.1)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2)
+ rd_find_by_param (0.1.1)
+ activerecord (~> 3.0)
+ activesupport (~> 3.0)
+ rd_resource_controller (1.0.1)
+ rdoc (3.11)
+ json (~> 1.4)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.4)
+ rspec-expectations (2.6.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.6.0)
+ rspec-rails (2.6.1)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ railties (~> 3.0)
+ rspec (~> 2.6.0)
+ spree_core (0.70.0)
+ activemerchant (= 1.17.0)
+ acts_as_list (= 0.1.4)
+ deface (>= 0.6.1)
+ faker (= 1.0.0)
+ highline (= 1.5.1)
+ jquery-rails (>= 1.0.14)
+ kaminari (>= 0.12.4)
+ meta_search (= 1.1.1)
+ nested_set (= 1.6.8)
+ paperclip (= 2.4.1)
+ rails (= 3.1.1)
+ rd_find_by_param (= 0.1.1)
+ rd_resource_controller
+ state_machine (= 1.0.1)
+ stringex (= 1.0.3)
+ sprockets (2.0.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (!= 1.3.0, ~> 1.1)
+ sqlite3 (1.3.4)
+ state_machine (1.0.1)
+ stringex (1.0.3)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.30)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ rspec-rails
+ spree_analytics!
+ sqlite3
View
@@ -11,10 +11,12 @@ Example goes here.
Testing
-------
+Note: the spec/dummy/config/routes.rb file gets created with an
+incorrect engine name. It should be SpreeAnalytics::Engine.
Be sure to add the rspec-rails gem to your Gemfile and then create a dummy test app for the specs to run against.
- $ bundle exec rake test app
+ $ bundle exec rake test_app
$ bundle exec rspec spec
Copyright (c) 2011 [name of extension creator], released under the New BSD License
View
@@ -26,6 +26,12 @@ end
desc "Generates a dummy app for testing"
task :test_app do
- ENV['LIB_NAME'] = 'spree_analytics'
+
+ libname = 'spree_analytics'
+ def libname.classify
+ SpreeAnalytics
+ end
+
+ ENV['LIB_NAME'] = libname
Rake::Task['common:test_app'].invoke
end
@@ -10,7 +10,7 @@
it "includes jirafe configuration" do
tags = helper.analytics_tags
tags[:id].should be_kind_of String
- tags[:id].should eq "1"
+ tags[:id].should eq "2"
end
describe "Tracking Tags Customizations" do
View
@@ -1,9 +1,7 @@
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
-
-require File.expand_path("../../../config/environment.rb", __FILE__)
-
+require File.expand_path("../dummy/config/environment.rb", __FILE__)
require 'rspec/rails'

0 comments on commit e00c671

Please sign in to comment.