Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added gems, including rspec and cucumber

  • Loading branch information...
commit 22ec4d08108dd85b51c8ddf8b3f5739276d37393 1 parent 55720a2
spartan-developer authored January 18, 2012
BIN  .Gemfile.swp
Binary file not shown
1  .rspec
... ...
@@ -0,0 +1 @@
  1
+--colour
9  Gemfile
@@ -30,7 +30,12 @@ gem 'jquery-rails'
30 30
 # To use debugger
31 31
 # gem 'ruby-debug19', :require => 'ruby-debug'
32 32
 
  33
+group :test, :development do
  34
+  gem 'rspec-rails', '2.7.0'
  35
+end
  36
+
33 37
 group :test do
34  
-  # Pretty printed test output
35  
-  gem 'turn', :require => false
  38
+  gem 'cucumber-rails', '1.2.1'
  39
+  gem 'capybara', '1.1.2'
  40
+  gem 'database_cleaner', '0.7.1'
36 41
 end
58  Gemfile.lock
@@ -29,9 +29,17 @@ GEM
29 29
       activesupport (= 3.1.1)
30 30
     activesupport (3.1.1)
31 31
       multi_json (~> 1.0)
32  
-    ansi (1.4.1)
33 32
     arel (2.2.1)
34 33
     builder (3.0.0)
  34
+    capybara (1.1.2)
  35
+      mime-types (>= 1.16)
  36
+      nokogiri (>= 1.3.3)
  37
+      rack (>= 1.0.0)
  38
+      rack-test (>= 0.5.4)
  39
+      selenium-webdriver (~> 2.0)
  40
+      xpath (~> 0.1.4)
  41
+    childprocess (0.3.0)
  42
+      ffi (~> 1.0.6)
35 43
     coffee-rails (3.1.1)
36 44
       coffee-script (>= 2.2.0)
37 45
       railties (~> 3.1.0)
@@ -39,21 +47,39 @@ GEM
39 47
       coffee-script-source
40 48
       execjs
41 49
     coffee-script-source (1.2.0)
  50
+    cucumber (1.1.4)
  51
+      builder (>= 2.1.2)
  52
+      diff-lcs (>= 1.1.2)
  53
+      gherkin (~> 2.7.1)
  54
+      json (>= 1.4.6)
  55
+      term-ansicolor (>= 1.0.6)
  56
+    cucumber-rails (1.2.1)
  57
+      capybara (>= 1.1.2)
  58
+      cucumber (>= 1.1.3)
  59
+      nokogiri (>= 1.5.0)
  60
+    database_cleaner (0.7.1)
  61
+    diff-lcs (1.1.3)
42 62
     erubis (2.7.0)
43 63
     execjs (1.2.13)
44 64
       multi_json (~> 1.0)
  65
+    ffi (1.0.9)
  66
+    gherkin (2.7.3)
  67
+      json (>= 1.4.6)
45 68
     hike (1.2.1)
46 69
     i18n (0.6.0)
47 70
     jquery-rails (1.0.19)
48 71
       railties (~> 3.0)
49 72
       thor (~> 0.14)
50 73
     json (1.6.5)
  74
+    json_pure (1.5.4)
  75
+      spruz (~> 0.2.8)
51 76
     mail (2.3.0)
52 77
       i18n (>= 0.4.0)
53 78
       mime-types (~> 1.16)
54 79
       treetop (~> 1.4.8)
55 80
     mime-types (1.17.2)
56 81
     multi_json (1.0.4)
  82
+    nokogiri (1.5.0)
57 83
     polyglot (0.3.3)
58 84
     rack (1.3.6)
59 85
     rack-cache (1.1)
@@ -82,37 +108,61 @@ GEM
82 108
     rake (0.9.2.2)
83 109
     rdoc (3.12)
84 110
       json (~> 1.4)
  111
+    rspec (2.7.0)
  112
+      rspec-core (~> 2.7.0)
  113
+      rspec-expectations (~> 2.7.0)
  114
+      rspec-mocks (~> 2.7.0)
  115
+    rspec-core (2.7.1)
  116
+    rspec-expectations (2.7.0)
  117
+      diff-lcs (~> 1.1.2)
  118
+    rspec-mocks (2.7.0)
  119
+    rspec-rails (2.7.0)
  120
+      actionpack (~> 3.0)
  121
+      activesupport (~> 3.0)
  122
+      railties (~> 3.0)
  123
+      rspec (~> 2.7.0)
  124
+    rubyzip (0.9.4)
85 125
     sass (3.1.12)
86 126
     sass-rails (3.1.5)
87 127
       actionpack (~> 3.1.0)
88 128
       railties (~> 3.1.0)
89 129
       sass (~> 3.1.10)
90 130
       tilt (~> 1.3.2)
  131
+    selenium-webdriver (2.8.0)
  132
+      childprocess (>= 0.2.1)
  133
+      ffi (>= 1.0.7)
  134
+      json_pure
  135
+      rubyzip
91 136
     sprockets (2.0.3)
92 137
       hike (~> 1.2)
93 138
       rack (~> 1.0)
94 139
       tilt (~> 1.1, != 1.3.0)
  140
+    spruz (0.2.13)
95 141
     sqlite3 (1.3.5)
  142
+    term-ansicolor (1.0.6)
96 143
     thor (0.14.6)
97 144
     tilt (1.3.3)
98 145
     treetop (1.4.10)
99 146
       polyglot
100 147
       polyglot (>= 0.3.1)
101  
-    turn (0.8.3)
102  
-      ansi
103 148
     tzinfo (0.3.31)
104 149
     uglifier (1.2.2)
105 150
       execjs (>= 0.3.0)
106 151
       multi_json (>= 1.0.2)
  152
+    xpath (0.1.4)
  153
+      nokogiri (~> 1.3)
107 154
 
108 155
 PLATFORMS
109 156
   ruby
110 157
 
111 158
 DEPENDENCIES
  159
+  capybara (= 1.1.2)
112 160
   coffee-rails (~> 3.1.1)
  161
+  cucumber-rails (= 1.2.1)
  162
+  database_cleaner (= 0.7.1)
113 163
   jquery-rails
114 164
   rails (= 3.1.1)
  165
+  rspec-rails (= 2.7.0)
115 166
   sass-rails (~> 3.1.4)
116 167
   sqlite3
117  
-  turn
118 168
   uglifier (>= 1.0.3)
16  bin/autospec
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'autospec' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('rspec-core', 'autospec')
16  bin/cdiff
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'cdiff' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('term-ansicolor', 'cdiff')
16  bin/cucumber
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'cucumber' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('cucumber', 'cucumber')
16  bin/decolor
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'decolor' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('term-ansicolor', 'decolor')
16  bin/edit_json.rb
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'edit_json.rb' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('json_pure', 'edit_json.rb')
16  bin/enum
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'enum' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('spruz', 'enum')
16  bin/erubis
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'erubis' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('erubis', 'erubis')
16  bin/htmldiff
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'htmldiff' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('diff-lcs', 'htmldiff')
16  bin/ldiff
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'ldiff' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('diff-lcs', 'ldiff')
16  bin/nokogiri
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'nokogiri' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('nokogiri', 'nokogiri')
16  bin/prettify_json.rb
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'prettify_json.rb' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('json_pure', 'prettify_json.rb')
16  bin/rackup
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'rackup' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('rack', 'rackup')
16  bin/rails
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'rails' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('rails', 'rails')
16  bin/rake
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'rake' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('rake', 'rake')
16  bin/rake2thor
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'rake2thor' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('thor', 'rake2thor')
16  bin/rdoc
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'rdoc' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('rdoc', 'rdoc')
16  bin/ri
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'ri' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('rdoc', 'ri')
16  bin/rspec
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'rspec' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('rspec-core', 'rspec')
16  bin/sass
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'sass' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('sass', 'sass')
16  bin/sass-convert
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'sass-convert' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('sass', 'sass-convert')
16  bin/scss
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'scss' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('sass', 'scss')
16  bin/thor
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'thor' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('thor', 'thor')
16  bin/tilt
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'tilt' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('tilt', 'tilt')
16  bin/tt
... ...
@@ -0,0 +1,16 @@
  1
+#!/usr/bin/env ruby
  2
+#
  3
+# This file was generated by Bundler.
  4
+#
  5
+# The application 'tt' is installed as part of a gem, and
  6
+# this file is here to facilitate running it.
  7
+#
  8
+
  9
+require 'pathname'
  10
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
  11
+  Pathname.new(__FILE__).realpath)
  12
+
  13
+require 'rubygems'
  14
+require 'bundler/setup'
  15
+
  16
+load Gem.bin_path('treetop', 'tt')
8  config/cucumber.yml
... ...
@@ -0,0 +1,8 @@
  1
+<%
  2
+rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
  3
+rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
  4
+std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
  5
+%>
  6
+default: <%= std_opts %> features
  7
+wip: --tags @wip:3 --wip features
  8
+rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
5  config/database.yml
@@ -12,7 +12,7 @@ development:
12 12
 # Warning: The database defined as "test" will be erased and
13 13
 # re-generated from your development database when you run "rake".
14 14
 # Do not set this db to the same as development or production.
15  
-test:
  15
+test: &test
16 16
   adapter: sqlite3
17 17
   database: db/test.sqlite3
18 18
   pool: 5
@@ -23,3 +23,6 @@ production:
23 23
   database: db/production.sqlite3
24 24
   pool: 5
25 25
   timeout: 5000
  26
+
  27
+cucumber:
  28
+  <<: *test
56  features/support/env.rb
... ...
@@ -0,0 +1,56 @@
  1
+# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
  2
+# It is recommended to regenerate this file in the future when you upgrade to a 
  3
+# newer version of cucumber-rails. Consider adding your own code to a new file 
  4
+# instead of editing this one. Cucumber will automatically load all features/**/*.rb
  5
+# files.
  6
+
  7
+require 'cucumber/rails'
  8
+
  9
+# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
  10
+# order to ease the transition to Capybara we set the default here. If you'd
  11
+# prefer to use XPath just remove this line and adjust any selectors in your
  12
+# steps to use the XPath syntax.
  13
+Capybara.default_selector = :css
  14
+
  15
+# By default, any exception happening in your Rails application will bubble up
  16
+# to Cucumber so that your scenario will fail. This is a different from how 
  17
+# your application behaves in the production environment, where an error page will 
  18
+# be rendered instead.
  19
+#
  20
+# Sometimes we want to override this default behaviour and allow Rails to rescue
  21
+# exceptions and display an error page (just like when the app is running in production).
  22
+# Typical scenarios where you want to do this is when you test your error pages.
  23
+# There are two ways to allow Rails to rescue exceptions:
  24
+#
  25
+# 1) Tag your scenario (or feature) with @allow-rescue
  26
+#
  27
+# 2) Set the value below to true. Beware that doing this globally is not
  28
+# recommended as it will mask a lot of errors for you!
  29
+#
  30
+ActionController::Base.allow_rescue = false
  31
+
  32
+# Remove/comment out the lines below if your app doesn't have a database.
  33
+# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
  34
+begin
  35
+  DatabaseCleaner.strategy = :transaction
  36
+rescue NameError
  37
+  raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
  38
+end
  39
+
  40
+# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
  41
+# See the DatabaseCleaner documentation for details. Example:
  42
+#
  43
+#   Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
  44
+#     DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
  45
+#   end
  46
+#
  47
+#   Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
  48
+#     DatabaseCleaner.strategy = :transaction
  49
+#   end
  50
+#
  51
+
  52
+# Possible values are :truncation and :transaction
  53
+# The :transaction strategy is faster, but might give you threading problems.
  54
+# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
  55
+Cucumber::Rails::Database.javascript_strategy = :truncation
  56
+
65  lib/tasks/cucumber.rake
... ...
@@ -0,0 +1,65 @@
  1
+# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
  2
+# It is recommended to regenerate this file in the future when you upgrade to a 
  3
+# newer version of cucumber-rails. Consider adding your own code to a new file 
  4
+# instead of editing this one. Cucumber will automatically load all features/**/*.rb
  5
+# files.
  6
+
  7
+
  8
+unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
  9
+
  10
+vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
  11
+$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
  12
+
  13
+begin
  14
+  require 'cucumber/rake/task'
  15
+
  16
+  namespace :cucumber do
  17
+    Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
  18
+      t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
  19
+      t.fork = true # You may get faster startup if you set this to false
  20
+      t.profile = 'default'
  21
+    end
  22
+
  23
+    Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
  24
+      t.binary = vendored_cucumber_bin
  25
+      t.fork = true # You may get faster startup if you set this to false
  26
+      t.profile = 'wip'
  27
+    end
  28
+
  29
+    Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
  30
+      t.binary = vendored_cucumber_bin
  31
+      t.fork = true # You may get faster startup if you set this to false
  32
+      t.profile = 'rerun'
  33
+    end
  34
+
  35
+    desc 'Run all features'
  36
+    task :all => [:ok, :wip]
  37
+
  38
+    task :statsetup do
  39
+      require 'rails/code_statistics'
  40
+      ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
  41
+      ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
  42
+    end
  43
+  end
  44
+  desc 'Alias for cucumber:ok'
  45
+  task :cucumber => 'cucumber:ok'
  46
+
  47
+  task :default => :cucumber
  48
+
  49
+  task :features => :cucumber do
  50
+    STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
  51
+  end
  52
+
  53
+  # In case we don't have ActiveRecord, append a no-op task that we can depend upon.
  54
+  task 'db:test:prepare' do
  55
+  end
  56
+
  57
+  task :stats => 'cucumber:statsetup'
  58
+rescue LoadError
  59
+  desc 'cucumber rake task not available (cucumber not installed)'
  60
+  task :cucumber do
  61
+    abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
  62
+  end
  63
+end
  64
+
  65
+end
10  script/cucumber
... ...
@@ -0,0 +1,10 @@
  1
+#!/usr/bin/env ruby
  2
+
  3
+vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
  4
+if vendored_cucumber_bin
  5
+  load File.expand_path(vendored_cucumber_bin)
  6
+else
  7
+  require 'rubygems' unless ENV['NO_RUBYGEMS']
  8
+  require 'cucumber'
  9
+  load Cucumber::BINARY
  10
+end
33  spec/spec_helper.rb
... ...
@@ -0,0 +1,33 @@
  1
+# This file is copied to spec/ when you run 'rails generate rspec:install'
  2
+ENV["RAILS_ENV"] ||= 'test'
  3
+require File.expand_path("../../config/environment", __FILE__)
  4
+require 'rspec/rails'
  5
+require 'rspec/autorun'
  6
+
  7
+# Requires supporting ruby files with custom matchers and macros, etc,
  8
+# in spec/support/ and its subdirectories.
  9
+Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
  10
+
  11
+RSpec.configure do |config|
  12
+  # == Mock Framework
  13
+  #
  14
+  # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
  15
+  #
  16
+  # config.mock_with :mocha
  17
+  # config.mock_with :flexmock
  18
+  # config.mock_with :rr
  19
+  config.mock_with :rspec
  20
+
  21
+  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  22
+  config.fixture_path = "#{::Rails.root}/spec/fixtures"
  23
+
  24
+  # If you're not using ActiveRecord, or you'd prefer not to run each of your
  25
+  # examples within a transaction, remove the following line or assign false
  26
+  # instead of true.
  27
+  config.use_transactional_fixtures = true
  28
+
  29
+  # If true, the base class of anonymous controllers will be inferred
  30
+  # automatically. This will be the default behavior in future versions of
  31
+  # rspec-rails.
  32
+  config.infer_base_class_for_anonymous_controllers = false
  33
+end
0  test/fixtures/.gitkeep
No changes.
0  test/functional/.gitkeep
No changes.
0  test/integration/.gitkeep
No changes.
12  test/performance/browsing_test.rb
... ...
@@ -1,12 +0,0 @@
1  
-require 'test_helper'
2  
-require 'rails/performance_test_help'
3  
-
4  
-class BrowsingTest < ActionDispatch::PerformanceTest
5  
-  # Refer to the documentation for all available options
6  
-  # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
7  
-  #                          :output => 'tmp/performance', :formats => [:flat] }
8  
-
9  
-  def test_homepage
10  
-    get '/'
11  
-  end
12  
-end
13  test/test_helper.rb
... ...
@@ -1,13 +0,0 @@
1  
-ENV["RAILS_ENV"] = "test"
2  
-require File.expand_path('../../config/environment', __FILE__)
3  
-require 'rails/test_help'
4  
-
5  
-class ActiveSupport::TestCase
6  
-  # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
7  
-  #
8  
-  # Note: You'll currently still have to declare fixtures explicitly in integration tests
9  
-  # -- they do not yet inherit this setting
10  
-  fixtures :all
11  
-
12  
-  # Add more helper methods to be used by all tests here...
13  
-end
0  test/unit/.gitkeep
No changes.

0 notes on commit 22ec4d0

Please sign in to comment.
Something went wrong with that request. Please try again.