spreewald 0.5.10 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +7 -10
- data/Rakefile +38 -1
- data/lib/spreewald/table_steps.rb +5 -2
- data/lib/spreewald/web_steps.rb +1 -0
- data/lib/spreewald_support/version.rb +1 -1
- data/tests/rails-2.3/Gemfile +17 -0
- data/tests/rails-2.3/Rakefile +11 -0
- data/tests/rails-2.3/config/boot.rb +128 -0
- data/tests/rails-2.3/config/database.yml +6 -0
- data/tests/rails-2.3/config/environment.rb +11 -0
- data/tests/rails-2.3/config/environments/cucumber.rb +6 -0
- data/tests/rails-2.3/config/initializers/backtrace_silencers.rb +7 -0
- data/tests/rails-2.3/config/initializers/cookie_verification_secret.rb +7 -0
- data/tests/rails-2.3/config/initializers/inflections.rb +10 -0
- data/tests/rails-2.3/config/initializers/mime_types.rb +5 -0
- data/tests/rails-2.3/config/initializers/new_rails_defaults.rb +21 -0
- data/tests/rails-2.3/config/initializers/session_store.rb +15 -0
- data/tests/rails-2.3/config/preinitializer.rb +20 -0
- data/tests/rails-2.3/config/routes.rb +5 -0
- data/tests/rails-2.3/features/support/env.rb +65 -0
- data/tests/rails-2.3/features/support/paths.rb +16 -0
- data/tests/rails-2.3/scripts/generate +3 -0
- data/tests/rails-3.2/Gemfile +13 -0
- data/tests/rails-3.2/Rakefile +12 -0
- data/tests/rails-3.2/config/application.rb +29 -0
- data/tests/rails-3.2/config/boot.rb +15 -0
- data/tests/rails-3.2/config/database.yml +6 -0
- data/tests/rails-3.2/config/environment.rb +9 -0
- data/tests/rails-3.2/config/initializers/backtrace_silencers.rb +9 -0
- data/tests/rails-3.2/config/initializers/inflections.rb +12 -0
- data/tests/rails-3.2/config/initializers/mime_types.rb +7 -0
- data/tests/rails-3.2/config/initializers/secret_token.rb +9 -0
- data/tests/rails-3.2/config/initializers/session_store.rb +5 -0
- data/tests/rails-3.2/config/routes.rb +5 -0
- data/tests/rails-3.2/features/support/env.rb +65 -0
- data/tests/rails-3.2/features/support/paths.rb +16 -0
- data/tests/shared/app/controllers/application_controller.rb +2 -0
- data/tests/shared/app/controllers/emails_controller.rb +19 -0
- data/tests/shared/app/controllers/tables_controller.rb +3 -0
- data/tests/shared/app/models/mailer.rb +25 -0
- data/tests/shared/app/views/layouts/application.html.haml +5 -0
- data/tests/shared/app/views/tables/table1.html.haml +13 -0
- data/tests/shared/config/database.sample.yml +6 -0
- data/tests/shared/db/migrate/.gitignore +0 -0
- data/tests/shared/features/shared/emails.feature +16 -0
- data/tests/shared/features/shared/step_definitions/test_steps.rb +32 -0
- data/tests/shared/features/shared/tables.feature +279 -0
- data/tests/shared/features/support/paths.rb +16 -0
- metadata +48 -4
data/.gitignore
CHANGED
@@ -2,17 +2,14 @@
|
|
2
2
|
*.rbc
|
3
3
|
.bundle
|
4
4
|
.config
|
5
|
+
.DS_Store
|
6
|
+
.idea
|
5
7
|
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
8
|
coverage
|
10
9
|
doc/
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
10
|
+
Gemfile.lock
|
11
|
+
InstalledFiles
|
12
|
+
tests/shared/config/database.yml
|
17
13
|
tmp
|
18
|
-
|
14
|
+
_yardoc
|
15
|
+
*.log
|
data/Rakefile
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
2
|
require "bundler/gem_tasks"
|
3
3
|
|
4
|
+
desc 'Default: Run all tests.'
|
5
|
+
task :default => 'tests:run' # now you can run the tests by just typing "rake" into your console
|
6
|
+
|
4
7
|
|
5
8
|
desc 'Update the "Steps" section of the README'
|
6
|
-
task
|
9
|
+
task :update_readme do
|
7
10
|
require 'support/documentation_generator'
|
8
11
|
readme = File.read('README.md')
|
9
12
|
start_of_steps_section = readme =~ /^## Steps/
|
@@ -11,3 +14,37 @@ task "update_readme" do
|
|
11
14
|
readme[start_of_steps_section, length_of_steps_section] = "## Steps\n\n" + DocumentationGenerator::StepDefinitionsDirectory.new('lib/spreewald').format
|
12
15
|
File.open('README.md', 'w') { |f| f.write(readme) }
|
13
16
|
end
|
17
|
+
|
18
|
+
namespace :tests do
|
19
|
+
|
20
|
+
desc "Run tests on all test apps"
|
21
|
+
task :run do # to run the tests type "rake tests:run" into your console
|
22
|
+
success = true
|
23
|
+
for_each_directory_of('tests/**/Rakefile') do |directory|
|
24
|
+
env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
|
25
|
+
success &= system("cd #{directory} && #{env} bundle exec rake features")
|
26
|
+
end
|
27
|
+
fail "Tests failed" unless success
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Bundle all test apps"
|
31
|
+
task :bundle do
|
32
|
+
for_each_directory_of('tests/**/Gemfile') do |directory|
|
33
|
+
system("cd #{directory} && rm -f Gemfile.lock && bundle install")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
desc 'Shortcut for creating a database'
|
38
|
+
task :create_database do
|
39
|
+
system("mysql -uroot -p -e 'create database spreewald_test;'")
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
def for_each_directory_of(path, &block)
|
45
|
+
Dir[path].sort.each do |rakefile|
|
46
|
+
directory = File.dirname(rakefile)
|
47
|
+
puts '', "\033[44m#{directory}\033[0m", ''
|
48
|
+
block.call(directory)
|
49
|
+
end
|
50
|
+
end
|
@@ -46,6 +46,7 @@ module TableStepsHelper
|
|
46
46
|
@best_rows_matched = -1
|
47
47
|
options = args.extract_options!
|
48
48
|
expected_table = args.first
|
49
|
+
skipped_rows = []
|
49
50
|
tables.any? do |table|
|
50
51
|
rows_matched = 0
|
51
52
|
match = expected_table.all? do |expected_row|
|
@@ -62,13 +63,15 @@ module TableStepsHelper
|
|
62
63
|
if options[:unordered]
|
63
64
|
table.delete_at(first_row)
|
64
65
|
else
|
66
|
+
skipped_rows += table[0...first_row]
|
65
67
|
table = table[(first_row + 1)..-1]
|
66
68
|
end
|
67
69
|
true
|
68
70
|
end
|
69
71
|
end
|
70
|
-
|
71
|
-
|
72
|
+
remaining_rows = skipped_rows + table
|
73
|
+
if match and options[:exactly] and not remaining_rows.empty?
|
74
|
+
@extra_rows = remaining_rows
|
72
75
|
match = false
|
73
76
|
end
|
74
77
|
match
|
data/lib/spreewald/web_steps.rb
CHANGED
@@ -223,6 +223,7 @@ end
|
|
223
223
|
Then /^(?:|I )should be on (.+)$/ do |page_name|
|
224
224
|
patiently do
|
225
225
|
fragment = URI.parse(current_url).fragment
|
226
|
+
fragment.sub!(/[#?].*/, '') if fragment # most js frameworks will usually use ? and # for params, we dont care about those
|
226
227
|
current_path = URI.parse(current_url).path
|
227
228
|
current_path << "##{fragment}" if fragment.present?
|
228
229
|
expected_path = _path_to(page_name)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '~>2.3'
|
4
|
+
|
5
|
+
gem 'mysql2', '~>0.2.1'
|
6
|
+
gem 'activerecord-mysql2-adapter'
|
7
|
+
gem 'ruby-debug', :platforms => :ruby_18
|
8
|
+
gem 'database_cleaner'
|
9
|
+
|
10
|
+
gem "capybara", "1.1.1"
|
11
|
+
gem "cucumber", "1.1.0"
|
12
|
+
gem "cucumber-rails", '=0.3.2'
|
13
|
+
gem 'rspec-rails', '~>1.3'
|
14
|
+
|
15
|
+
gem 'haml', '<3'
|
16
|
+
|
17
|
+
gem 'spreewald', :path => '../..'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'cucumber/rake/task'
|
3
|
+
|
4
|
+
desc 'Default: Run all specs for a specific rails version.'
|
5
|
+
task :default => :features
|
6
|
+
|
7
|
+
desc 'Run all specs for rails 2.3'
|
8
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
9
|
+
# tell cucumber where it finds it files (subdirectories and symlinks are confusing it)
|
10
|
+
t.cucumber_opts = "--require features --require features/shared features/shared/"
|
11
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# Don't change this file!
|
2
|
+
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
+
|
4
|
+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
+
|
6
|
+
module Rails
|
7
|
+
class << self
|
8
|
+
def boot!
|
9
|
+
unless booted?
|
10
|
+
preinitialize
|
11
|
+
pick_boot.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def booted?
|
16
|
+
defined? Rails::Initializer
|
17
|
+
end
|
18
|
+
|
19
|
+
def pick_boot
|
20
|
+
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
+
end
|
22
|
+
|
23
|
+
def vendor_rails?
|
24
|
+
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
+
end
|
26
|
+
|
27
|
+
def preinitialize
|
28
|
+
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
+
end
|
30
|
+
|
31
|
+
def preinitializer_path
|
32
|
+
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class Boot
|
37
|
+
def run
|
38
|
+
load_initializer
|
39
|
+
Rails::Initializer.run(:set_load_path)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class VendorBoot < Boot
|
44
|
+
def load_initializer
|
45
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
+
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
+
Rails::GemDependency.add_frozen_gem_path
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class GemBoot < Boot
|
52
|
+
def load_initializer
|
53
|
+
self.class.load_rubygems
|
54
|
+
load_rails_gem
|
55
|
+
require 'initializer'
|
56
|
+
end
|
57
|
+
|
58
|
+
def load_rails_gem
|
59
|
+
if version = self.class.gem_version
|
60
|
+
gem 'rails', version
|
61
|
+
else
|
62
|
+
gem 'rails'
|
63
|
+
end
|
64
|
+
rescue Gem::LoadError => load_error
|
65
|
+
if load_error.message =~ /Could not find RubyGem rails/
|
66
|
+
STDERR.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
67
|
+
exit 1
|
68
|
+
else
|
69
|
+
raise
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
class << self
|
74
|
+
def rubygems_version
|
75
|
+
Gem::RubyGemsVersion rescue nil
|
76
|
+
end
|
77
|
+
|
78
|
+
def gem_version
|
79
|
+
if defined? RAILS_GEM_VERSION
|
80
|
+
RAILS_GEM_VERSION
|
81
|
+
elsif ENV.include?('RAILS_GEM_VERSION')
|
82
|
+
ENV['RAILS_GEM_VERSION']
|
83
|
+
else
|
84
|
+
parse_gem_version(read_environment_rb)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def load_rubygems
|
89
|
+
min_version = '1.3.2'
|
90
|
+
require 'rubygems'
|
91
|
+
unless rubygems_version >= min_version
|
92
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
93
|
+
exit 1
|
94
|
+
end
|
95
|
+
|
96
|
+
rescue LoadError
|
97
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
98
|
+
exit 1
|
99
|
+
end
|
100
|
+
|
101
|
+
def parse_gem_version(text)
|
102
|
+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
103
|
+
end
|
104
|
+
|
105
|
+
private
|
106
|
+
def read_environment_rb
|
107
|
+
File.read("#{RAILS_ROOT}/config/environment.rb")
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
class Rails::Boot
|
114
|
+
def run
|
115
|
+
load_initializer
|
116
|
+
|
117
|
+
Rails::Initializer.class_eval do
|
118
|
+
def load_gems
|
119
|
+
@bundler_loaded ||= Bundler.require :default, Rails.env
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
Rails::Initializer.run(:set_load_path)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# All that for this:
|
128
|
+
Rails.boot!
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file
|
2
|
+
|
3
|
+
# Specifies gem version of Rails to use when vendor/rails is not present
|
4
|
+
RAILS_GEM_VERSION = '2.3.18' unless defined? RAILS_GEM_VERSION
|
5
|
+
|
6
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
7
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
8
|
+
|
9
|
+
Rails::Initializer.run do |config|
|
10
|
+
config.time_zone = 'UTC'
|
11
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
ActionController::Base.cookie_verifier_secret = '4d6b24a9d5bfac6edceecec91d4f9c82b22c7155c1569080a4173d1bf833ed5970652f7da6626949cf71ed764f0294627e6160c899d8279f11e84bde7a9f20b4';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# These settings change the behavior of Rails 2 apps and will be defaults
|
4
|
+
# for Rails 3. You can remove this initializer when Rails 3 is released.
|
5
|
+
|
6
|
+
if defined?(ActiveRecord)
|
7
|
+
# Include Active Record class name as root for JSON serialized output.
|
8
|
+
ActiveRecord::Base.include_root_in_json = true
|
9
|
+
|
10
|
+
# Store the full class name (including module namespace) in STI type column.
|
11
|
+
ActiveRecord::Base.store_full_sti_class = true
|
12
|
+
end
|
13
|
+
|
14
|
+
ActionController::Routing.generate_best_match = false
|
15
|
+
|
16
|
+
# Use ISO 8601 format for JSON serialized times and dates.
|
17
|
+
ActiveSupport.use_standard_json_time_format = true
|
18
|
+
|
19
|
+
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
|
20
|
+
# if you're including raw json in an HTML page.
|
21
|
+
ActiveSupport.escape_html_entities_in_json = false
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying cookie session data integrity.
|
4
|
+
# If you change this key, all old sessions will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
ActionController::Base.session = {
|
8
|
+
:key => '_spreewald_test_session',
|
9
|
+
:secret => 'cd29dba6c040376838de77ac6d96c2ca6377989989069d4da7abe097b50ef0679dc60251bdee61cb9e7da1253546fe9af87b74752725f91bdbb258f22f061102'
|
10
|
+
}
|
11
|
+
|
12
|
+
# Use the database for sessions instead of the cookie-based default,
|
13
|
+
# which shouldn't be used to store highly confidential information
|
14
|
+
# (create the session table with "rake db:sessions:create")
|
15
|
+
# ActionController::Base.session_store = :active_record_store
|
@@ -0,0 +1,20 @@
|
|
1
|
+
begin
|
2
|
+
require "rubygems"
|
3
|
+
require "bundler"
|
4
|
+
rescue LoadError
|
5
|
+
raise "Could not load the bundler gem. Install it with `gem install bundler`."
|
6
|
+
end
|
7
|
+
|
8
|
+
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
|
9
|
+
raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
|
10
|
+
"Run `gem install bundler` to upgrade."
|
11
|
+
end
|
12
|
+
|
13
|
+
begin
|
14
|
+
# Set up load paths for all bundled gems
|
15
|
+
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
|
16
|
+
Bundler.setup
|
17
|
+
rescue Bundler::GemNotFound
|
18
|
+
raise RuntimeError, "Bundler couldn't find some gems." +
|
19
|
+
"Did you run `bundle install`?"
|
20
|
+
end
|
@@ -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
|
+
ENV["RAILS_ENV"] ||= "cucumber"
|
8
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
|
9
|
+
|
10
|
+
# require 'spec/support/blueprints'
|
11
|
+
# require 'features/support/find_or_make'
|
12
|
+
|
13
|
+
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
|
14
|
+
require 'cucumber/rails/world'
|
15
|
+
require 'cucumber/rails/rspec'
|
16
|
+
require 'cucumber/rails/active_record'
|
17
|
+
require 'cucumber/web/tableish'
|
18
|
+
|
19
|
+
require 'capybara/rails'
|
20
|
+
require 'capybara/cucumber'
|
21
|
+
require 'capybara/session'
|
22
|
+
|
23
|
+
|
24
|
+
# load Spreewald steps
|
25
|
+
require File.expand_path('../../lib/spreewald/all_steps')
|
26
|
+
|
27
|
+
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
28
|
+
# order to ease the transition to Capybara we set the default here. If you'd
|
29
|
+
# prefer to use XPath just remove this line and adjust any selectors in your
|
30
|
+
# steps to use the XPath syntax.
|
31
|
+
Capybara.default_selector = :css
|
32
|
+
|
33
|
+
# If you set this to false, any error raised from within your app will bubble
|
34
|
+
# up to your step definition and out to cucumber unless you catch it somewhere
|
35
|
+
# on the way. You can make Rails rescue errors and render error pages on a
|
36
|
+
# per-scenario basis by tagging a scenario or feature with the @allow-rescue tag.
|
37
|
+
#
|
38
|
+
# If you set this to true, Rails will rescue all errors and render error
|
39
|
+
# pages, more or less in the same way your application would behave in the
|
40
|
+
# default production environment. It's not recommended to do this for all
|
41
|
+
# of your scenarios, as this makes it hard to discover errors in your application.
|
42
|
+
ActionController::Base.allow_rescue = false
|
43
|
+
|
44
|
+
# If you set this to true, each scenario will run in a database transaction.
|
45
|
+
# You can still turn off transactions on a per-scenario basis, simply tagging
|
46
|
+
# a feature or scenario with the @no-txn tag. If you are using Capybara,
|
47
|
+
# tagging with @culerity or @javascript will also turn transactions off.
|
48
|
+
#
|
49
|
+
# If you set this to false, transactions will be off for all scenarios,
|
50
|
+
# regardless of whether you use @no-txn or not.
|
51
|
+
#
|
52
|
+
# Beware that turning transactions off will leave data in your database
|
53
|
+
# after each scenario, which can lead to hard-to-debug failures in
|
54
|
+
# subsequent scenarios. If you do this, we recommend you create a Before
|
55
|
+
# block that will explicitly put your database in a known state.
|
56
|
+
Cucumber::Rails::World.use_transactional_fixtures = true
|
57
|
+
# How to clean your database when transactions are turned off. See
|
58
|
+
# http://github.com/bmabey/database_cleaner for more info.
|
59
|
+
if defined?(ActiveRecord::Base)
|
60
|
+
begin
|
61
|
+
require 'database_cleaner'
|
62
|
+
DatabaseCleaner.strategy = :truncation
|
63
|
+
rescue LoadError => ignore_if_database_cleaner_not_present
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module NavigationHelpers
|
2
|
+
|
3
|
+
def path_to(page_name)
|
4
|
+
case page_name
|
5
|
+
when /^"(.*)"$/
|
6
|
+
$1
|
7
|
+
|
8
|
+
else
|
9
|
+
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
|
10
|
+
"Now, go and add a mapping in #{__FILE__}"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
World(NavigationHelpers)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '~>3.2'
|
4
|
+
gem 'mysql2'
|
5
|
+
gem 'ruby-debug', :platforms => :ruby_18
|
6
|
+
gem 'database_cleaner'
|
7
|
+
gem 'capybara', "~>1" # for ruby 1.8.7 (capybara 2.x requires ruby 1.9)
|
8
|
+
# gem 'andand'
|
9
|
+
|
10
|
+
gem 'rspec-rails'
|
11
|
+
gem 'spreewald', :path => '../..'
|
12
|
+
|
13
|
+
gem 'haml-rails'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'cucumber/rake/task'
|
3
|
+
|
4
|
+
desc 'Default: Run all specs for a specific rails version.'
|
5
|
+
task :default => :features
|
6
|
+
|
7
|
+
desc 'Run all specs for rails 3.2'
|
8
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
9
|
+
# tell cucumber where it finds it files (subdirectories and symlinks are confusing it)
|
10
|
+
t.cucumber_opts = "--require features --require features/shared features/shared/"
|
11
|
+
end
|
12
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path('../boot', __FILE__)
|
4
|
+
|
5
|
+
require 'rails/all'
|
6
|
+
|
7
|
+
# If you have a Gemfile, require the gems listed there, including any gems
|
8
|
+
# you've limited to :test, :development, or :production.
|
9
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
10
|
+
|
11
|
+
module SpreewaldTest
|
12
|
+
class Application < Rails::Application
|
13
|
+
config.encoding = "utf-8"
|
14
|
+
|
15
|
+
config.cache_classes = true
|
16
|
+
config.whiny_nils = true
|
17
|
+
|
18
|
+
config.consider_all_requests_local = true
|
19
|
+
config.action_controller.perform_caching = false
|
20
|
+
config.action_controller.allow_forgery_protection = false
|
21
|
+
|
22
|
+
config.action_dispatch.show_exceptions = false
|
23
|
+
config.action_mailer.delivery_method = :test
|
24
|
+
config.action_mailer.raise_delivery_errors = true
|
25
|
+
config.active_support.deprecation = :stderr
|
26
|
+
|
27
|
+
config.root = File.expand_path('../..', __FILE__)
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
# Set up gems listed in the Gemfile.
|
6
|
+
gemfile = File.expand_path('../../Gemfile', __FILE__)
|
7
|
+
begin
|
8
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
9
|
+
require 'bundler'
|
10
|
+
Bundler.setup
|
11
|
+
rescue Bundler::GemNotFound => e
|
12
|
+
STDERR.puts e.message
|
13
|
+
STDERR.puts "Try running `bundle install`."
|
14
|
+
exit!
|
15
|
+
end if File.exist?(gemfile)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Load the rails application
|
4
|
+
require File.expand_path('../application', __FILE__)
|
5
|
+
|
6
|
+
# Initialize the rails application
|
7
|
+
SpreewaldTest::Application.initialize!
|
8
|
+
|
9
|
+
RSPEC_EXPECTATION_NOT_MET_ERROR = RSpec::Expectations::ExpectationNotMetError
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
6
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
7
|
+
|
8
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
9
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# Add new inflection rules using the following format
|
6
|
+
# (all these examples are active by default):
|
7
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
8
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
9
|
+
# inflect.singular /^(ox)en/i, '\1'
|
10
|
+
# inflect.irregular 'person', 'people'
|
11
|
+
# inflect.uncountable %w( fish sheep )
|
12
|
+
# end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# Your secret key for verifying the integrity of signed cookies.
|
6
|
+
# If you change this key, all old signed cookies will become invalid!
|
7
|
+
# Make sure the secret is at least 30 characters and all random,
|
8
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
9
|
+
SpreewaldTest::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
|
@@ -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
|
+
ENV["RAILS_ENV"] ||= "cucumber"
|
8
|
+
|
9
|
+
require 'cucumber/rails'
|
10
|
+
# require 'capybara/rails'
|
11
|
+
# require 'spec/support/blueprints'
|
12
|
+
# require 'cucumber/rspec/doubles'
|
13
|
+
# require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
14
|
+
|
15
|
+
# load Spreewald steps
|
16
|
+
require File.expand_path('../../lib/spreewald/all_steps')
|
17
|
+
|
18
|
+
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
19
|
+
# order to ease the transition to Capybara we set the default here. If you'd
|
20
|
+
# prefer to use XPath just remove this line and adjust any selectors in your
|
21
|
+
# steps to use the XPath syntax.
|
22
|
+
Capybara.default_selector = :css
|
23
|
+
|
24
|
+
# By default, any exception happening in your Rails application will bubble up
|
25
|
+
# to Cucumber so that your scenario will fail. This is a different from how
|
26
|
+
# your application behaves in the production environment, where an error page will
|
27
|
+
# be rendered instead.
|
28
|
+
#
|
29
|
+
# Sometimes we want to override this default behaviour and allow Rails to rescue
|
30
|
+
# exceptions and display an error page (just like when the app is running in production).
|
31
|
+
# Typical scenarios where you want to do this is when you test your error pages.
|
32
|
+
# There are two ways to allow Rails to rescue exceptions:
|
33
|
+
#
|
34
|
+
# 1) Tag your scenario (or feature) with @allow-rescue
|
35
|
+
#
|
36
|
+
# 2) Set the value below to true. Beware that doing this globally is not
|
37
|
+
# recommended as it will mask a lot of errors for you!
|
38
|
+
#
|
39
|
+
ActionController::Base.allow_rescue = false
|
40
|
+
|
41
|
+
# Remove/comment out the lines below if your app doesn't have a database.
|
42
|
+
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
|
43
|
+
DatabaseCleaner.strategy = :transaction
|
44
|
+
|
45
|
+
# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
|
46
|
+
# See the DatabaseCleaner documentation for details. Example:
|
47
|
+
#
|
48
|
+
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
|
49
|
+
# # { :except => [:widgets] } may not do what you expect here
|
50
|
+
# # as tCucumber::Rails::Database.javascript_strategy overrides
|
51
|
+
# # this setting.
|
52
|
+
# DatabaseCleaner.strategy = :truncation
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
|
56
|
+
# DatabaseCleaner.strategy = :transaction
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
|
60
|
+
# Possible values are :truncation and :transaction
|
61
|
+
# The :transaction strategy is faster, but might give you threading problems.
|
62
|
+
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
|
63
|
+
Cucumber::Rails::Database.javascript_strategy = :deletion
|
64
|
+
|
65
|
+
Capybara.default_wait_time = 5
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module NavigationHelpers
|
2
|
+
|
3
|
+
def path_to(page_name)
|
4
|
+
case page_name
|
5
|
+
when /^"(.*)"$/
|
6
|
+
$1
|
7
|
+
|
8
|
+
else
|
9
|
+
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
|
10
|
+
"Now, go and add a mapping in #{__FILE__}"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
World(NavigationHelpers)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class EmailsController < ApplicationController
|
2
|
+
|
3
|
+
def do_nothing
|
4
|
+
render :nothing => true
|
5
|
+
end
|
6
|
+
|
7
|
+
def send_email
|
8
|
+
text = params[:id].to_s
|
9
|
+
|
10
|
+
if Rails.version >= "3"
|
11
|
+
Mailer.email(text).deliver
|
12
|
+
else
|
13
|
+
Mailer.deliver_email(text)
|
14
|
+
end
|
15
|
+
|
16
|
+
render :nothing => true
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Mailer < ActionMailer::Base
|
2
|
+
|
3
|
+
if Rails.version >= "3"
|
4
|
+
|
5
|
+
default :from => "from@example.com",
|
6
|
+
:to => "to@example.com"
|
7
|
+
|
8
|
+
def email(body = "body")
|
9
|
+
mail(:subject => "email") do |format|
|
10
|
+
format.text { render :text => body }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
else
|
15
|
+
|
16
|
+
def email(body_text = "body")
|
17
|
+
recipients EMAIL_RECIPIENT
|
18
|
+
from EMAIL_SENDER
|
19
|
+
subject "email"
|
20
|
+
body body_text
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Feature: Test Spreewald's email steps
|
2
|
+
|
3
|
+
Scenario: /^no e?mail should have been sent$/
|
4
|
+
When I go to "/emails/do_nothing"
|
5
|
+
Then the following step should succeed:
|
6
|
+
| no email should have been sent |
|
7
|
+
|
8
|
+
When I go to "/emails/send_email"
|
9
|
+
Then the following step should fail:
|
10
|
+
| no email should have been sent |
|
11
|
+
|
12
|
+
|
13
|
+
Scenario: /^I should see "([^\"]*)" in the e?mail$/
|
14
|
+
When I go to "/emails/send_email/message_body"
|
15
|
+
Then the following step should succeed:
|
16
|
+
| I should see "message_body" in the email |
|
@@ -0,0 +1,32 @@
|
|
1
|
+
Then /^the following steps? should (fail|succeed):$/ do |expectation, steps_table|
|
2
|
+
steps = steps_table.raw.flatten
|
3
|
+
|
4
|
+
steps.each do |step|
|
5
|
+
if expectation == 'fail'
|
6
|
+
expect { step(step) }.to raise_error(RSPEC_EXPECTATION_NOT_MET_ERROR)
|
7
|
+
|
8
|
+
else # succeed
|
9
|
+
step(step)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
When /^I run the following steps?:$/ do |steps_table|
|
16
|
+
steps = steps_table.raw.flatten
|
17
|
+
|
18
|
+
steps.each do |step|
|
19
|
+
step(step)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Then /^the following multiline step should (fail|succeed):$/ do |expectation, multiline_step|
|
24
|
+
|
25
|
+
if expectation == 'fail'
|
26
|
+
expect { steps(multiline_step) }.to raise_error(RSPEC_EXPECTATION_NOT_MET_ERROR)
|
27
|
+
else # succeed
|
28
|
+
steps(multiline_step)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,279 @@
|
|
1
|
+
Feature: Table steps
|
2
|
+
|
3
|
+
Background:
|
4
|
+
When I go to "/tables/table1"
|
5
|
+
|
6
|
+
|
7
|
+
Scenario: should see a table with the following rows
|
8
|
+
Then the following multiline step should succeed:
|
9
|
+
"""
|
10
|
+
Then I should see a table with the following rows:
|
11
|
+
| 1-1 | 1-2 | 1-3 |
|
12
|
+
| 2-1 | 2-2 | 2-3 |
|
13
|
+
| 3-1 | 3-2 | 3-3 |
|
14
|
+
"""
|
15
|
+
And the following multiline step should succeed:
|
16
|
+
"""
|
17
|
+
Then I should see a table with the following rows:
|
18
|
+
| 1-1 | 1-3 |
|
19
|
+
| 2-1 | 2-3 |
|
20
|
+
| 3-1 | 3-3 |
|
21
|
+
"""
|
22
|
+
And the following multiline step should succeed:
|
23
|
+
"""
|
24
|
+
Then I should see a table with the following rows:
|
25
|
+
| 1-2 | 1-3 |
|
26
|
+
| 2-2 | 2-3 |
|
27
|
+
| 3-2 | 3-3 |
|
28
|
+
"""
|
29
|
+
And the following multiline step should succeed:
|
30
|
+
"""
|
31
|
+
Then I should see a table with the following rows:
|
32
|
+
| 1-1 | 1-2 | 1-3 |
|
33
|
+
| 3-1 | 3-2 | 3-3 |
|
34
|
+
"""
|
35
|
+
And the following multiline step should succeed:
|
36
|
+
"""
|
37
|
+
Then I should see a table with the following rows:
|
38
|
+
| 2-1 | 2-2 | 2-3 |
|
39
|
+
| 3-1 | 3-2 | 3-3 |
|
40
|
+
"""
|
41
|
+
And the following multiline step should succeed:
|
42
|
+
"""
|
43
|
+
Then I should see a table with the following rows:
|
44
|
+
| 1-1 | 1-2 | 1-3 |
|
45
|
+
| 2-1 | 2-2 | 2-3 |
|
46
|
+
"""
|
47
|
+
And the following multiline step should succeed:
|
48
|
+
"""
|
49
|
+
Then I should see a table with the following rows:
|
50
|
+
| 1-1 | 1-3 |
|
51
|
+
| 3-1 | 3-3 |
|
52
|
+
"""
|
53
|
+
And the following multiline step should succeed:
|
54
|
+
"""
|
55
|
+
Then I should see a table with the following rows:
|
56
|
+
| 1* | 1-3 |
|
57
|
+
| 3* | 3-3 |
|
58
|
+
"""
|
59
|
+
And the following multiline step should fail:
|
60
|
+
"""
|
61
|
+
Then I should see a table with the following rows:
|
62
|
+
| 3-1 | 3-2 | 3-3 |
|
63
|
+
| 1-1 | 1-2 | 1-3 |
|
64
|
+
| 2-1 | 2-2 | 2-3 |
|
65
|
+
"""
|
66
|
+
But the following multiline step should fail:
|
67
|
+
"""
|
68
|
+
Then I should see a table with the following rows:
|
69
|
+
| 1-1 | 1-2 | 1-3 |
|
70
|
+
| 2-1 | 2-2 | 2-3 |
|
71
|
+
| 3-1 | 3-2 | foo |
|
72
|
+
"""
|
73
|
+
And the following multiline step should fail:
|
74
|
+
"""
|
75
|
+
Then I should see a table with the following rows:
|
76
|
+
| 1-1 | 1-2 | 1-3 |
|
77
|
+
| 2-1 | foo | 2-3 |
|
78
|
+
| 3-1 | 3-2 | 3-3 |
|
79
|
+
"""
|
80
|
+
And the following multiline step should fail:
|
81
|
+
"""
|
82
|
+
Then I should see a table with the following rows:
|
83
|
+
| 1 | 1-3 |
|
84
|
+
| 3 | 3-3 |
|
85
|
+
"""
|
86
|
+
|
87
|
+
|
88
|
+
Scenario: should not see a table with the following rows
|
89
|
+
Then the following multiline step should fail:
|
90
|
+
"""
|
91
|
+
Then I should not see a table with the following rows:
|
92
|
+
| 1-1 | 1-2 | 1-3 |
|
93
|
+
| 2-1 | 2-2 | 2-3 |
|
94
|
+
| 3-1 | 3-2 | 3-3 |
|
95
|
+
"""
|
96
|
+
But the following multiline step should succeed:
|
97
|
+
"""
|
98
|
+
Then I should not see a table with the following rows:
|
99
|
+
| 3-1 | 3-2 | 3-3 |
|
100
|
+
| 1-1 | 1-2 | 1-3 |
|
101
|
+
| 2-1 | 2-2 | 2-3 |
|
102
|
+
"""
|
103
|
+
|
104
|
+
|
105
|
+
Scenario: should see a table with exactly the following rows
|
106
|
+
Then the following multiline step should succeed:
|
107
|
+
"""
|
108
|
+
Then I should see a table with exactly the following rows:
|
109
|
+
| 1-1 | 1-2 | 1-3 |
|
110
|
+
| 2-1 | 2-2 | 2-3 |
|
111
|
+
| 3-1 | 3-2 | 3-3 |
|
112
|
+
"""
|
113
|
+
And the following multiline step should succeed:
|
114
|
+
"""
|
115
|
+
Then I should see a table with exactly the following rows:
|
116
|
+
| 1-1 | 1-3 |
|
117
|
+
| 2-1 | 2-3 |
|
118
|
+
| 3-1 | 3-3 |
|
119
|
+
"""
|
120
|
+
But the following multiline step should fail:
|
121
|
+
"""
|
122
|
+
Then I should see a table with exactly the following rows:
|
123
|
+
| 2-1 | 2-2 | 2-3 |
|
124
|
+
| 1-1 | 1-2 | 1-3 |
|
125
|
+
| 3-1 | 3-2 | 3-3 |
|
126
|
+
"""
|
127
|
+
And the following multiline step should fail:
|
128
|
+
"""
|
129
|
+
Then I should see a table with exactly the following rows:
|
130
|
+
| 1-1 | 1-2 | 1-3 |
|
131
|
+
| 3-1 | 3-2 | 3-3 |
|
132
|
+
"""
|
133
|
+
|
134
|
+
Scenario: should not see a table with exactly the following rows
|
135
|
+
Then the following multiline step should fail:
|
136
|
+
"""
|
137
|
+
Then I should not see a table with exactly the following rows:
|
138
|
+
| 1-1 | 1-2 | 1-3 |
|
139
|
+
| 2-1 | 2-2 | 2-3 |
|
140
|
+
| 3-1 | 3-2 | 3-3 |
|
141
|
+
"""
|
142
|
+
And the following multiline step should fail:
|
143
|
+
"""
|
144
|
+
Then I should not see a table with exactly the following rows:
|
145
|
+
| 1-1 | 1-3 |
|
146
|
+
| 2-1 | 2-3 |
|
147
|
+
| 3-1 | 3-3 |
|
148
|
+
"""
|
149
|
+
But the following multiline step should succeed:
|
150
|
+
"""
|
151
|
+
Then I should not see a table with exactly the following rows:
|
152
|
+
| 2-1 | 2-2 | 2-3 |
|
153
|
+
| 1-1 | 1-2 | 1-3 |
|
154
|
+
| 3-1 | 3-2 | 3-3 |
|
155
|
+
"""
|
156
|
+
And the following multiline step should succeed:
|
157
|
+
"""
|
158
|
+
Then I should not see a table with exactly the following rows:
|
159
|
+
| 1-1 | 1-2 | 1-3 |
|
160
|
+
| 3-1 | 3-2 | 3-3 |
|
161
|
+
"""
|
162
|
+
|
163
|
+
|
164
|
+
Scenario: should see a table with the following rows in any order
|
165
|
+
Then the following multiline step should succeed:
|
166
|
+
"""
|
167
|
+
Then I should see a table with the following rows in any order:
|
168
|
+
| 1-1 | 1-2 | 1-3 |
|
169
|
+
| 2-1 | 2-2 | 2-3 |
|
170
|
+
| 3-1 | 3-2 | 3-3 |
|
171
|
+
"""
|
172
|
+
And the following multiline step should succeed:
|
173
|
+
"""
|
174
|
+
Then I should see a table with the following rows in any order:
|
175
|
+
| 1-1 | 1-2 | 1-3 |
|
176
|
+
| 3-1 | 3-2 | 3-3 |
|
177
|
+
"""
|
178
|
+
And the following multiline step should succeed:
|
179
|
+
"""
|
180
|
+
Then I should see a table with the following rows in any order:
|
181
|
+
| 3-1 | 3-2 | 3-3 |
|
182
|
+
| 1-1 | 1-2 | 1-3 |
|
183
|
+
| 2-1 | 2-2 | 2-3 |
|
184
|
+
"""
|
185
|
+
But the following multiline step should fail:
|
186
|
+
"""
|
187
|
+
Then I should see a table with the following rows in any order:
|
188
|
+
| 1-1 | 1-2 | 1-3 |
|
189
|
+
| 2-1 | 2-2 | 2-3 |
|
190
|
+
| 3-1 | 3-2 | foo |
|
191
|
+
"""
|
192
|
+
And the following multiline step should fail:
|
193
|
+
"""
|
194
|
+
Then I should see a table with the following rows in any order:
|
195
|
+
| 1 | 1-3 |
|
196
|
+
| 3 | 3-3 |
|
197
|
+
"""
|
198
|
+
|
199
|
+
|
200
|
+
Scenario: should not see a table with the following rows in any order
|
201
|
+
Then the following multiline step should fail:
|
202
|
+
"""
|
203
|
+
Then I should not see a table with the following rows in any order:
|
204
|
+
| 1-1 | 1-2 | 1-3 |
|
205
|
+
| 2-1 | 2-2 | 2-3 |
|
206
|
+
| 3-1 | 3-2 | 3-3 |
|
207
|
+
"""
|
208
|
+
And the following multiline step should fail:
|
209
|
+
"""
|
210
|
+
Then I should not see a table with the following rows in any order:
|
211
|
+
| 1-1 | 1-2 | 1-3 |
|
212
|
+
| 3-1 | 3-2 | 3-3 |
|
213
|
+
"""
|
214
|
+
And the following multiline step should fail:
|
215
|
+
"""
|
216
|
+
Then I should not see a table with the following rows in any order:
|
217
|
+
| 3-1 | 3-2 | 3-3 |
|
218
|
+
| 1-1 | 1-2 | 1-3 |
|
219
|
+
| 2-1 | 2-2 | 2-3 |
|
220
|
+
"""
|
221
|
+
But the following multiline step should succeed:
|
222
|
+
"""
|
223
|
+
Then I should not see a table with the following rows in any order:
|
224
|
+
| 1-1 | 1-2 | 1-3 |
|
225
|
+
| 2-1 | 2-2 | 2-3 |
|
226
|
+
| 3-1 | 3-2 | foo |
|
227
|
+
"""
|
228
|
+
And the following multiline step should succeed:
|
229
|
+
"""
|
230
|
+
Then I should not see a table with the following rows in any order:
|
231
|
+
| 1 | 1-3 |
|
232
|
+
| 3 | 3-3 |
|
233
|
+
"""
|
234
|
+
|
235
|
+
|
236
|
+
Scenario: should see a table with exactly the following rows in any order
|
237
|
+
Then the following multiline step should succeed:
|
238
|
+
"""
|
239
|
+
Then I should see a table with exactly the following rows in any order:
|
240
|
+
| 1-1 | 1-2 | 1-3 |
|
241
|
+
| 2-1 | 2-2 | 2-3 |
|
242
|
+
| 3-1 | 3-2 | 3-3 |
|
243
|
+
"""
|
244
|
+
And the following multiline step should succeed:
|
245
|
+
"""
|
246
|
+
Then I should see a table with exactly the following rows in any order:
|
247
|
+
| 3-1 | 3-2 | 3-3 |
|
248
|
+
| 1-1 | 1-2 | 1-3 |
|
249
|
+
| 2-1 | 2-2 | 2-3 |
|
250
|
+
"""
|
251
|
+
But the following multiline step should fail:
|
252
|
+
"""
|
253
|
+
Then I should see a table with exactly the following rows in any order:
|
254
|
+
| 1-1 | 1-2 | 1-3 |
|
255
|
+
| 3-1 | 3-2 | 3-3 |
|
256
|
+
"""
|
257
|
+
|
258
|
+
|
259
|
+
Scenario: should not see a table with exactly the following rows in any order
|
260
|
+
Then the following multiline step should fail:
|
261
|
+
"""
|
262
|
+
Then I should not see a table with exactly the following rows in any order:
|
263
|
+
| 1-1 | 1-2 | 1-3 |
|
264
|
+
| 2-1 | 2-2 | 2-3 |
|
265
|
+
| 3-1 | 3-2 | 3-3 |
|
266
|
+
"""
|
267
|
+
And the following multiline step should fail:
|
268
|
+
"""
|
269
|
+
Then I should not see a table with exactly the following rows in any order:
|
270
|
+
| 3-1 | 3-2 | 3-3 |
|
271
|
+
| 1-1 | 1-2 | 1-3 |
|
272
|
+
| 2-1 | 2-2 | 2-3 |
|
273
|
+
"""
|
274
|
+
But the following multiline step should succeed:
|
275
|
+
"""
|
276
|
+
Then I should not see a table with exactly the following rows in any order:
|
277
|
+
| 1-1 | 1-2 | 1-3 |
|
278
|
+
| 3-1 | 3-2 | 3-3 |
|
279
|
+
"""
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module NavigationHelpers
|
2
|
+
|
3
|
+
def path_to(page_name)
|
4
|
+
case page_name
|
5
|
+
when /^"(.*)"$/
|
6
|
+
$1
|
7
|
+
|
8
|
+
else
|
9
|
+
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
|
10
|
+
"Now, go and add a mapping in #{__FILE__}"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
World(NavigationHelpers)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreewald
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 11
|
10
|
+
version: 0.5.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tobias Kraze
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-04-30 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -93,6 +93,50 @@ files:
|
|
93
93
|
- lib/spreewald_support/version.rb
|
94
94
|
- spreewald.gemspec
|
95
95
|
- support/documentation_generator.rb
|
96
|
+
- tests/rails-2.3/Gemfile
|
97
|
+
- tests/rails-2.3/Rakefile
|
98
|
+
- tests/rails-2.3/config/boot.rb
|
99
|
+
- tests/rails-2.3/config/database.yml
|
100
|
+
- tests/rails-2.3/config/environment.rb
|
101
|
+
- tests/rails-2.3/config/environments/cucumber.rb
|
102
|
+
- tests/rails-2.3/config/initializers/backtrace_silencers.rb
|
103
|
+
- tests/rails-2.3/config/initializers/cookie_verification_secret.rb
|
104
|
+
- tests/rails-2.3/config/initializers/inflections.rb
|
105
|
+
- tests/rails-2.3/config/initializers/mime_types.rb
|
106
|
+
- tests/rails-2.3/config/initializers/new_rails_defaults.rb
|
107
|
+
- tests/rails-2.3/config/initializers/session_store.rb
|
108
|
+
- tests/rails-2.3/config/preinitializer.rb
|
109
|
+
- tests/rails-2.3/config/routes.rb
|
110
|
+
- tests/rails-2.3/features/support/env.rb
|
111
|
+
- tests/rails-2.3/features/support/paths.rb
|
112
|
+
- tests/rails-2.3/scripts/generate
|
113
|
+
- tests/rails-3.2/.DS_Store
|
114
|
+
- tests/rails-3.2/Gemfile
|
115
|
+
- tests/rails-3.2/Rakefile
|
116
|
+
- tests/rails-3.2/config/application.rb
|
117
|
+
- tests/rails-3.2/config/boot.rb
|
118
|
+
- tests/rails-3.2/config/database.yml
|
119
|
+
- tests/rails-3.2/config/environment.rb
|
120
|
+
- tests/rails-3.2/config/initializers/backtrace_silencers.rb
|
121
|
+
- tests/rails-3.2/config/initializers/inflections.rb
|
122
|
+
- tests/rails-3.2/config/initializers/mime_types.rb
|
123
|
+
- tests/rails-3.2/config/initializers/secret_token.rb
|
124
|
+
- tests/rails-3.2/config/initializers/session_store.rb
|
125
|
+
- tests/rails-3.2/config/routes.rb
|
126
|
+
- tests/rails-3.2/features/support/env.rb
|
127
|
+
- tests/rails-3.2/features/support/paths.rb
|
128
|
+
- tests/shared/app/controllers/application_controller.rb
|
129
|
+
- tests/shared/app/controllers/emails_controller.rb
|
130
|
+
- tests/shared/app/controllers/tables_controller.rb
|
131
|
+
- tests/shared/app/models/mailer.rb
|
132
|
+
- tests/shared/app/views/layouts/application.html.haml
|
133
|
+
- tests/shared/app/views/tables/table1.html.haml
|
134
|
+
- tests/shared/config/database.sample.yml
|
135
|
+
- tests/shared/db/migrate/.gitignore
|
136
|
+
- tests/shared/features/shared/emails.feature
|
137
|
+
- tests/shared/features/shared/step_definitions/test_steps.rb
|
138
|
+
- tests/shared/features/shared/tables.feature
|
139
|
+
- tests/shared/features/support/paths.rb
|
96
140
|
has_rdoc: true
|
97
141
|
homepage: https://github.com/makandra/spreewald
|
98
142
|
licenses: []
|