Add resque_spec to test queuing mail.
This commit is contained in:
parent
6617eaaf9b
commit
5303cc285a
6 changed files with 13 additions and 2 deletions
1
Gemfile
1
Gemfile
|
@ -77,4 +77,5 @@ group :test do
|
||||||
gem "simplecov", :require => false
|
gem "simplecov", :require => false
|
||||||
gem "shoulda-matchers"
|
gem "shoulda-matchers"
|
||||||
gem 'email_spec'
|
gem 'email_spec'
|
||||||
|
gem 'resque_spec'
|
||||||
end
|
end
|
||||||
|
|
|
@ -263,6 +263,9 @@ GEM
|
||||||
resque_mailer (2.0.3)
|
resque_mailer (2.0.3)
|
||||||
actionmailer (>= 3.0.0)
|
actionmailer (>= 3.0.0)
|
||||||
resque (>= 1.2.3)
|
resque (>= 1.2.3)
|
||||||
|
resque_spec (0.11.0)
|
||||||
|
resque (>= 1.19.0)
|
||||||
|
rspec (>= 2.5.0)
|
||||||
rspec (2.10.0)
|
rspec (2.10.0)
|
||||||
rspec-core (~> 2.10.0)
|
rspec-core (~> 2.10.0)
|
||||||
rspec-expectations (~> 2.10.0)
|
rspec-expectations (~> 2.10.0)
|
||||||
|
@ -391,6 +394,7 @@ DEPENDENCIES
|
||||||
redcarpet (~> 2.1.1)
|
redcarpet (~> 2.1.1)
|
||||||
resque (~> 1.20.0)
|
resque (~> 1.20.0)
|
||||||
resque_mailer
|
resque_mailer
|
||||||
|
resque_spec
|
||||||
rspec-rails
|
rspec-rails
|
||||||
sass-rails (= 3.2.5)
|
sass-rails (= 3.2.5)
|
||||||
seed-fu
|
seed-fu
|
||||||
|
|
1
config/initializers/resque_mailer.rb
Normal file
1
config/initializers/resque_mailer.rb
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Resque::Mailer.excluded_environments = []
|
|
@ -88,6 +88,7 @@ describe "Admin::Projects" do
|
||||||
fill_in 'Name', :with => 'NewProject'
|
fill_in 'Name', :with => 'NewProject'
|
||||||
fill_in 'Code', :with => 'NPR'
|
fill_in 'Code', :with => 'NPR'
|
||||||
fill_in 'Path', :with => 'gitlabhq_1'
|
fill_in 'Path', :with => 'gitlabhq_1'
|
||||||
|
fill_in 'Description', :with => 'New Project Description'
|
||||||
expect { click_button "Save" }.to change { Project.count }.by(1)
|
expect { click_button "Save" }.to change { Project.count }.by(1)
|
||||||
@project = Project.last
|
@project = Project.last
|
||||||
end
|
end
|
||||||
|
|
|
@ -45,7 +45,9 @@ describe "Admin::Users" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should send valid email to user with email & password" do
|
it "should send valid email to user with email & password" do
|
||||||
|
with_resque do
|
||||||
click_button "Save"
|
click_button "Save"
|
||||||
|
end
|
||||||
user = User.last
|
user = User.last
|
||||||
email = ActionMailer::Base.deliveries.last
|
email = ActionMailer::Base.deliveries.last
|
||||||
email.subject.should have_content("Account was created")
|
email.subject.should have_content("Account was created")
|
||||||
|
|
|
@ -133,7 +133,9 @@ describe "Issues" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should send valid email to user" do
|
it "should send valid email to user" do
|
||||||
|
with_resque do
|
||||||
click_button "Submit new issue"
|
click_button "Submit new issue"
|
||||||
|
end
|
||||||
issue = Issue.last
|
issue = Issue.last
|
||||||
email = ActionMailer::Base.deliveries.last
|
email = ActionMailer::Base.deliveries.last
|
||||||
email.subject.should have_content("New Issue was created")
|
email.subject.should have_content("New Issue was created")
|
||||||
|
|
Loading…
Reference in a new issue