spreewald 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +75 -3
- data/Rakefile +6 -4
- data/lib/spreewald/email_steps.rb +4 -3
- data/lib/spreewald/file_attachment_steps.rb +6 -0
- data/lib/spreewald_support/version.rb +1 -1
- data/spreewald.gemspec +1 -1
- data/tests/rails-2.3/Gemfile.lock +1 -1
- data/tests/rails-2.3/config/database.yml +1 -10
- data/tests/rails-3.2/Gemfile.lock +1 -1
- data/tests/rails-3.2/config/database.yml +1 -10
- data/tests/shared/features/shared/email_steps.feature +16 -0
- metadata +54 -6
data/README.md
CHANGED
@@ -99,13 +99,16 @@ Marks scenario as pending
|
|
99
99
|
Then an email should have been sent with:
|
100
100
|
"""
|
101
101
|
From: max.mustermann@example.com
|
102
|
+
Reply-To: mmuster@gmail.com
|
102
103
|
To: john.doe@example.com
|
103
|
-
Subject:
|
104
|
-
Body: ...
|
104
|
+
Subject: The subject may contain "quotes"
|
105
105
|
Attachments: ...
|
106
|
+
|
107
|
+
Message body goes here.
|
106
108
|
"""
|
107
109
|
|
108
|
-
You can skip lines, of course.
|
110
|
+
You can skip lines, of course. Note that the mail body is only checked for
|
111
|
+
_inclusion_.
|
109
112
|
|
110
113
|
|
111
114
|
* **When I follow the (first|second|third)? link in the e?mail**
|
@@ -148,6 +151,74 @@ Marks scenario as pending
|
|
148
151
|
|
149
152
|
|
150
153
|
|
154
|
+
### file_attachment_steps.rb
|
155
|
+
|
156
|
+
Attach a file
|
157
|
+
|
158
|
+
Example:
|
159
|
+
|
160
|
+
Company.new.logo = File.new…
|
161
|
+
|
162
|
+
Given the file "…" was attached as logo to the company above
|
163
|
+
|
164
|
+
|
165
|
+
Example:
|
166
|
+
|
167
|
+
class Gallery
|
168
|
+
has_many :images, :as => :owner
|
169
|
+
end
|
170
|
+
|
171
|
+
class Image
|
172
|
+
belongs_to :owner, polymorphic: true
|
173
|
+
end
|
174
|
+
|
175
|
+
# so container = Image.new; container.file = File.new… , container.owner = object
|
176
|
+
|
177
|
+
Given the file "…" was attached as Image/file to the company above
|
178
|
+
|
179
|
+
|
180
|
+
Example:
|
181
|
+
|
182
|
+
Set updated_at with
|
183
|
+
|
184
|
+
Given … above at "2011-11-11 11:11"
|
185
|
+
|
186
|
+
|
187
|
+
* **Given the file "..." was attached( as (.../)?...)? to the ... above( at "...")?**
|
188
|
+
|
189
|
+
Attach a file
|
190
|
+
|
191
|
+
Example:
|
192
|
+
|
193
|
+
Company.new.logo = File.new…
|
194
|
+
|
195
|
+
Given the file "…" was attached as logo to the company above
|
196
|
+
|
197
|
+
|
198
|
+
Example:
|
199
|
+
|
200
|
+
class Gallery
|
201
|
+
has_many :images, :as => :owner
|
202
|
+
end
|
203
|
+
|
204
|
+
class Image
|
205
|
+
belongs_to :owner, polymorphic: true
|
206
|
+
end
|
207
|
+
|
208
|
+
# so container = Image.new; container.file = File.new… , container.owner = object
|
209
|
+
|
210
|
+
Given the file "…" was attached as Image/file to the company above
|
211
|
+
|
212
|
+
|
213
|
+
Example:
|
214
|
+
|
215
|
+
Set updated_at with
|
216
|
+
|
217
|
+
Given … above at "2011-11-11 11:11"
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
151
222
|
### table_steps.rb
|
152
223
|
|
153
224
|
Check the content of tables in your HTML.
|
@@ -382,6 +453,7 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
382
453
|
* **Then I should get a download with filename "..."**
|
383
454
|
|
384
455
|
Checks "Content-Disposition" HTTP header
|
456
|
+
Attention: Doesn't work with Selenium, see https://github.com/jnicklas/capybara#gotchas
|
385
457
|
|
386
458
|
|
387
459
|
* **Then "..." should be selected for "..."**
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require "bundler/gem_tasks"
|
3
3
|
|
4
4
|
desc 'Default: Run all tests.'
|
5
|
-
task :default => '
|
5
|
+
task :default => 'all:features'
|
6
6
|
|
7
7
|
|
8
8
|
desc 'Update the "Steps" section of the README'
|
@@ -41,10 +41,10 @@ namespace :travis do
|
|
41
41
|
|
42
42
|
end
|
43
43
|
|
44
|
-
namespace :
|
44
|
+
namespace :all do
|
45
45
|
|
46
46
|
desc "Run tests on all test apps"
|
47
|
-
task :
|
47
|
+
task :features do
|
48
48
|
success = true
|
49
49
|
for_each_directory_of('tests/**/Rakefile') do |directory|
|
50
50
|
Bundler.with_clean_env do
|
@@ -76,7 +76,9 @@ def for_each_directory_of(path, &block)
|
|
76
76
|
directory = File.dirname(rakefile)
|
77
77
|
puts '', "\033[44m#{directory}\033[0m", ''
|
78
78
|
|
79
|
-
|
79
|
+
if RUBY_VERSION.start_with?("1.9") and directory.include?("rails-2.3")
|
80
|
+
puts 'Skipping Rails 2.3 with Ruby 1.9.'
|
81
|
+
else
|
80
82
|
block.call(directory)
|
81
83
|
end
|
82
84
|
end
|
@@ -17,17 +17,18 @@ end
|
|
17
17
|
# From: max.mustermann@example.com
|
18
18
|
# Reply-To: mmuster@gmail.com
|
19
19
|
# To: john.doe@example.com
|
20
|
-
# Subject:
|
20
|
+
# Subject: The subject may contain "quotes"
|
21
21
|
# Attachments: ...
|
22
22
|
#
|
23
23
|
# Message body goes here.
|
24
24
|
# """
|
25
25
|
#
|
26
|
-
# You can skip lines, of course.
|
26
|
+
# You can skip lines, of course. Note that the mail body is only checked for
|
27
|
+
# _inclusion_.
|
27
28
|
Then /^(an|no) e?mail should have been sent with:$/ do |mode, raw_data|
|
28
29
|
patiently do
|
29
30
|
raw_data.strip!
|
30
|
-
header, body = raw_data.split(/\n\n
|
31
|
+
header, body = raw_data.split(/\n\n/, 2) # 2: maximum number of fields
|
31
32
|
conditions = {}
|
32
33
|
header.split("\n").each do |row|
|
33
34
|
if row.match(/^[a-z\-]+: /i)
|
@@ -22,6 +22,12 @@
|
|
22
22
|
# Given the file "…" was attached as Image/file to the company above
|
23
23
|
#
|
24
24
|
#
|
25
|
+
# Example:
|
26
|
+
#
|
27
|
+
# Set updated_at with
|
28
|
+
#
|
29
|
+
# Given … above at "2011-11-11 11:11"
|
30
|
+
#
|
25
31
|
Given /^the file "([^"]*)" was attached(?: as (?:([^"]*)\/)?([^"]*))? to the ([^"]*) above(?: at "([^"]*)")?$/ do
|
26
32
|
|path_to_file, container_name, relation_name, model_name, time_string|
|
27
33
|
|
data/spreewald.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
|
13
13
|
gem.files = `git ls-files`.split($\)
|
14
14
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
|
-
gem.test_files = gem.files.grep(%r{^
|
15
|
+
gem.test_files = gem.files.grep(%r{^tests/})
|
16
16
|
gem.name = "spreewald"
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
gem.version = Spreewald::VERSION
|
@@ -1,15 +1,6 @@
|
|
1
|
-
development:
|
2
|
-
adapter: mysql2
|
3
|
-
database: spreewald_development
|
4
|
-
encoding: utf8
|
5
|
-
host: localhost
|
6
|
-
username: root
|
7
|
-
password: junior
|
8
|
-
|
9
1
|
test:
|
10
2
|
adapter: mysql2
|
11
3
|
database: spreewald_test
|
12
|
-
encoding: utf8
|
13
4
|
host: localhost
|
14
5
|
username: root
|
15
|
-
password:
|
6
|
+
password: tomhanks
|
@@ -1,15 +1,6 @@
|
|
1
|
-
development:
|
2
|
-
adapter: mysql2
|
3
|
-
database: spreewald_development
|
4
|
-
encoding: utf8
|
5
|
-
host: localhost
|
6
|
-
username: root
|
7
|
-
password: junior
|
8
|
-
|
9
1
|
test:
|
10
2
|
adapter: mysql2
|
11
3
|
database: spreewald_test
|
12
|
-
encoding: utf8
|
13
4
|
host: localhost
|
14
5
|
username: root
|
15
|
-
password:
|
6
|
+
password: tomhanks
|
@@ -113,3 +113,19 @@ Feature: Test Spreewald's email steps
|
|
113
113
|
OTHER-BODY
|
114
114
|
'''
|
115
115
|
"""
|
116
|
+
|
117
|
+
# Test body with multiple paragraphs
|
118
|
+
Then the following multiline step should fail:
|
119
|
+
"""
|
120
|
+
Then an email should have been sent with:
|
121
|
+
'''
|
122
|
+
From: from@example.com
|
123
|
+
Reply-To: reply-to@example.com
|
124
|
+
To: to@example.com
|
125
|
+
Subject: SUBJECT
|
126
|
+
|
127
|
+
BODY
|
128
|
+
|
129
|
+
MORE-BODY
|
130
|
+
'''
|
131
|
+
"""
|
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: 61
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 1
|
10
|
+
version: 0.8.1
|
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-12-
|
18
|
+
date: 2013-12-09 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -178,5 +178,53 @@ rubygems_version: 1.3.9.5
|
|
178
178
|
signing_key:
|
179
179
|
specification_version: 3
|
180
180
|
summary: Collection of useful cucumber steps.
|
181
|
-
test_files:
|
182
|
-
|
181
|
+
test_files:
|
182
|
+
- tests/rails-2.3/Gemfile
|
183
|
+
- tests/rails-2.3/Gemfile.lock
|
184
|
+
- tests/rails-2.3/Rakefile
|
185
|
+
- tests/rails-2.3/config/boot.rb
|
186
|
+
- tests/rails-2.3/config/database.yml
|
187
|
+
- tests/rails-2.3/config/environment.rb
|
188
|
+
- tests/rails-2.3/config/environments/test.rb
|
189
|
+
- tests/rails-2.3/config/initializers/backtrace_silencers.rb
|
190
|
+
- tests/rails-2.3/config/initializers/cookie_verification_secret.rb
|
191
|
+
- tests/rails-2.3/config/initializers/inflections.rb
|
192
|
+
- tests/rails-2.3/config/initializers/mime_types.rb
|
193
|
+
- tests/rails-2.3/config/initializers/new_rails_defaults.rb
|
194
|
+
- tests/rails-2.3/config/initializers/session_store.rb
|
195
|
+
- tests/rails-2.3/config/preinitializer.rb
|
196
|
+
- tests/rails-2.3/config/routes.rb
|
197
|
+
- tests/rails-2.3/features/support/env.rb
|
198
|
+
- tests/rails-2.3/features/support/paths.rb
|
199
|
+
- tests/rails-2.3/scripts/generate
|
200
|
+
- tests/rails-3.2/.DS_Store
|
201
|
+
- tests/rails-3.2/Gemfile
|
202
|
+
- tests/rails-3.2/Gemfile.lock
|
203
|
+
- tests/rails-3.2/Rakefile
|
204
|
+
- tests/rails-3.2/config/application.rb
|
205
|
+
- tests/rails-3.2/config/boot.rb
|
206
|
+
- tests/rails-3.2/config/database.yml
|
207
|
+
- tests/rails-3.2/config/environment.rb
|
208
|
+
- tests/rails-3.2/config/initializers/backtrace_silencers.rb
|
209
|
+
- tests/rails-3.2/config/initializers/inflections.rb
|
210
|
+
- tests/rails-3.2/config/initializers/mime_types.rb
|
211
|
+
- tests/rails-3.2/config/initializers/secret_token.rb
|
212
|
+
- tests/rails-3.2/config/initializers/session_store.rb
|
213
|
+
- tests/rails-3.2/config/routes.rb
|
214
|
+
- tests/rails-3.2/features/support/env.rb
|
215
|
+
- tests/rails-3.2/features/support/paths.rb
|
216
|
+
- tests/shared/app/controllers/application_controller.rb
|
217
|
+
- tests/shared/app/controllers/emails_controller.rb
|
218
|
+
- tests/shared/app/controllers/forms_controller.rb
|
219
|
+
- tests/shared/app/controllers/tables_controller.rb
|
220
|
+
- tests/shared/app/models/mailer.rb
|
221
|
+
- tests/shared/app/views/forms/form1.html.haml
|
222
|
+
- tests/shared/app/views/layouts/application.html.haml
|
223
|
+
- tests/shared/app/views/tables/table1.html.haml
|
224
|
+
- tests/shared/config/database.sample.yml
|
225
|
+
- tests/shared/db/migrate/.gitignore
|
226
|
+
- tests/shared/features/shared/email_steps.feature
|
227
|
+
- tests/shared/features/shared/step_definitions/test_steps.rb
|
228
|
+
- tests/shared/features/shared/table_steps.feature
|
229
|
+
- tests/shared/features/shared/web_steps.feature
|
230
|
+
- tests/shared/features/support/paths.rb
|