bmabey-email_spec 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -3,6 +3,12 @@
3
3
  === New features
4
4
  === Bufixes
5
5
 
6
+ == 0.1.1 2008-3-26
7
+ === New features
8
+ * Switched dir structure over to support rubigen. (Dr. Nic)
9
+
10
+ === Bufixes
11
+
6
12
  == 0.1.0 2008-3-25
7
13
  === New features
8
14
  * Change Rakefile to run all specs and features, as well as prepare the db (Mischa Fierer)
data/Rakefile CHANGED
@@ -29,7 +29,7 @@ desc "Run the generator on the tests"
29
29
  task :generate do
30
30
  current_dir = File.expand_path(File.dirname(__FILE__))
31
31
  system "mkdir -p #{current_dir}/examples/rails_root/vendor/plugins/email_spec"
32
- system "cp -R #{current_dir}/generators #{current_dir}/examples/rails_root/vendor/plugins/email_spec"
32
+ system "cp -R #{current_dir}/rails_generators #{current_dir}/examples/rails_root/vendor/plugins/email_spec"
33
33
  system "cd #{current_dir}/examples/rails_root && ./script/generate email_spec"
34
34
  end
35
35
 
@@ -35,7 +35,7 @@ When /^I follow "(.*)" in the email$/ do |link|
35
35
  visit_in_email(link)
36
36
  end
37
37
 
38
- Then /^I should receive (.+) emails?$/ do |amount|
38
+ Then /^I should receive (an|\d+) emails?$/ do |amount|
39
39
  amount = 1 if amount == "an"
40
40
  unread_emails_for(current_email_address).size.should == amount.to_i
41
41
  end
@@ -68,4 +68,7 @@ When %r{^"([^']*?)" opens? the email with text "([^']*?)"$} do |address, text|
68
68
  open_email(address, :with_text => text)
69
69
  end
70
70
 
71
+ When /^I click the first link in the email$/ do
72
+ click_first_link_in_email
73
+ end
71
74
 
@@ -35,7 +35,7 @@ When /^I follow "(.*)" in the email$/ do |link|
35
35
  visit_in_email(link)
36
36
  end
37
37
 
38
- Then /^I should receive (.+) emails?$/ do |amount|
38
+ Then /^I should receive (an|\d+) emails?$/ do |amount|
39
39
  amount = 1 if amount == "an"
40
40
  unread_emails_for(current_email_address).size.should == amount.to_i
41
41
  end
@@ -68,4 +68,7 @@ When %r{^"([^']*?)" opens? the email with text "([^']*?)"$} do |address, text|
68
68
  open_email(address, :with_text => text)
69
69
  end
70
70
 
71
+ When /^I click the first link in the email$/ do
72
+ click_first_link_in_email
73
+ end
71
74
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmabey-email_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Mabey
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-03-25 00:00:00 -07:00
14
+ date: 2009-03-26 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies: []
17
17
 
@@ -38,10 +38,6 @@ files:
38
38
  - lib/email_spec/helpers.rb
39
39
  - lib/email_spec/matchers.rb
40
40
  - lib/email_spec.rb
41
- - generators/email_spec
42
- - generators/email_spec/email_spec_generator.rb
43
- - generators/email_spec/templates
44
- - generators/email_spec/templates/email_steps.rb
45
41
  - spec/email_spec
46
42
  - spec/email_spec/matchers_spec.rb
47
43
  - spec/spec.opts
@@ -153,11 +149,11 @@ files:
153
149
  - examples/rails_root/vendor
154
150
  - examples/rails_root/vendor/plugins
155
151
  - examples/rails_root/vendor/plugins/email_spec
156
- - examples/rails_root/vendor/plugins/email_spec/generators
157
- - examples/rails_root/vendor/plugins/email_spec/generators/email_spec
158
- - examples/rails_root/vendor/plugins/email_spec/generators/email_spec/email_spec_generator.rb
159
- - examples/rails_root/vendor/plugins/email_spec/generators/email_spec/templates
160
- - examples/rails_root/vendor/plugins/email_spec/generators/email_spec/templates/email_steps.rb
152
+ - examples/rails_root/vendor/plugins/email_spec/rails_generators
153
+ - examples/rails_root/vendor/plugins/email_spec/rails_generators/email_spec
154
+ - examples/rails_root/vendor/plugins/email_spec/rails_generators/email_spec/email_spec_generator.rb
155
+ - examples/rails_root/vendor/plugins/email_spec/rails_generators/email_spec/templates
156
+ - examples/rails_root/vendor/plugins/email_spec/rails_generators/email_spec/templates/email_steps.rb
161
157
  has_rdoc: true
162
158
  homepage: http://github.com/bmabey/email-spec/
163
159
  post_install_message:
@@ -1,16 +0,0 @@
1
- # This generator adds email steps to the step definitions directory
2
- class EmailSpecGenerator < Rails::Generator::Base
3
- def manifest
4
- record do |m|
5
- m.directory 'features/step_definitions'
6
- m.file 'email_steps.rb', 'features/step_definitions/email_steps.rb'
7
- end
8
- end
9
-
10
- protected
11
-
12
- def banner
13
- "Usage: #{$0} email_spec"
14
- end
15
-
16
- end
@@ -1,71 +0,0 @@
1
- #Commonly used email steps
2
- #
3
- # To add your own steps make a custom_email_steps.rb
4
- # The provided methods are:
5
- #
6
- # reset_mailer
7
- # open_last_email
8
- # visit_in_email
9
- # unread_emails_for
10
- # mailbox_for
11
- # current_email
12
- # open_email
13
- # read_emails_for
14
- # find_email
15
-
16
- module EmailHelpers
17
- def current_email_address
18
- "quentin@example.com" # Replace with your a way to find your current_email. e.g current_user.email
19
- end
20
- end
21
- World {|world| world.extend EmailHelpers }
22
-
23
- # Use this step to reset the e-mail queue within a scenario.
24
- # This is done automatically before each scenario.
25
- Given /^(?:a clear email queue|no emails have been sent)$/ do
26
- reset_mailer
27
- end
28
-
29
- # Use this step to open the most recently sent e-mail.
30
- When /^I open the email$/ do
31
- open_email(current_email_address)
32
- end
33
-
34
- When /^I follow "(.*)" in the email$/ do |link|
35
- visit_in_email(link)
36
- end
37
-
38
- Then /^I should receive (.+) emails?$/ do |amount|
39
- amount = 1 if amount == "an"
40
- unread_emails_for(current_email_address).size.should == amount.to_i
41
- end
42
-
43
- Then /^"([^']*?)" should receive (\d+) emails?$/ do |address, n|
44
- unread_emails_for(address).size.should == n.to_i
45
- end
46
-
47
- Then /^"([^']*?)" should have (\d+) emails?$/ do |address, n|
48
- mailbox_for(address).size.should == n.to_i
49
- end
50
-
51
- Then /^"([^']*?)" should not receive an email$/ do |address|
52
- find_email(address).should be_nil
53
- end
54
-
55
- Then /^I should see "(.*)" in the subject$/ do |text|
56
- current_email.should have_subject(Regexp.new(text))
57
- end
58
-
59
- Then /^I should see "(.*)" in the email$/ do |text|
60
- current_email.body.should =~ Regexp.new(text)
61
- end
62
-
63
- When %r{^"([^']*?)" opens? the email with subject "([^']*?)"$} do |address, subject|
64
- open_email(address, :with_subject => subject)
65
- end
66
-
67
- When %r{^"([^']*?)" opens? the email with text "([^']*?)"$} do |address, text|
68
- open_email(address, :with_text => text)
69
- end
70
-
71
-