Commit 5303cc285a2067b59f1e8b68f707e8dbf90fe59e
1 parent
6617eaaf
Exists in
master
and in
4 other branches
Add resque_spec to test queuing mail.
Showing
6 changed files
with
13 additions
and
2 deletions
Show diff stats
Gemfile
Gemfile.lock
| @@ -263,6 +263,9 @@ GEM | @@ -263,6 +263,9 @@ GEM | ||
| 263 | resque_mailer (2.0.3) | 263 | resque_mailer (2.0.3) |
| 264 | actionmailer (>= 3.0.0) | 264 | actionmailer (>= 3.0.0) |
| 265 | resque (>= 1.2.3) | 265 | resque (>= 1.2.3) |
| 266 | + resque_spec (0.11.0) | ||
| 267 | + resque (>= 1.19.0) | ||
| 268 | + rspec (>= 2.5.0) | ||
| 266 | rspec (2.10.0) | 269 | rspec (2.10.0) |
| 267 | rspec-core (~> 2.10.0) | 270 | rspec-core (~> 2.10.0) |
| 268 | rspec-expectations (~> 2.10.0) | 271 | rspec-expectations (~> 2.10.0) |
| @@ -391,6 +394,7 @@ DEPENDENCIES | @@ -391,6 +394,7 @@ DEPENDENCIES | ||
| 391 | redcarpet (~> 2.1.1) | 394 | redcarpet (~> 2.1.1) |
| 392 | resque (~> 1.20.0) | 395 | resque (~> 1.20.0) |
| 393 | resque_mailer | 396 | resque_mailer |
| 397 | + resque_spec | ||
| 394 | rspec-rails | 398 | rspec-rails |
| 395 | sass-rails (= 3.2.5) | 399 | sass-rails (= 3.2.5) |
| 396 | seed-fu | 400 | seed-fu |
| @@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
| 1 | +Resque::Mailer.excluded_environments = [] |
spec/requests/admin/admin_projects_spec.rb
| @@ -88,6 +88,7 @@ describe "Admin::Projects" do | @@ -88,6 +88,7 @@ describe "Admin::Projects" do | ||
| 88 | fill_in 'Name', :with => 'NewProject' | 88 | fill_in 'Name', :with => 'NewProject' |
| 89 | fill_in 'Code', :with => 'NPR' | 89 | fill_in 'Code', :with => 'NPR' |
| 90 | fill_in 'Path', :with => 'gitlabhq_1' | 90 | fill_in 'Path', :with => 'gitlabhq_1' |
| 91 | + fill_in 'Description', :with => 'New Project Description' | ||
| 91 | expect { click_button "Save" }.to change { Project.count }.by(1) | 92 | expect { click_button "Save" }.to change { Project.count }.by(1) |
| 92 | @project = Project.last | 93 | @project = Project.last |
| 93 | end | 94 | end |
spec/requests/admin/admin_users_spec.rb
| @@ -45,7 +45,9 @@ describe "Admin::Users" do | @@ -45,7 +45,9 @@ describe "Admin::Users" do | ||
| 45 | end | 45 | end |
| 46 | 46 | ||
| 47 | it "should send valid email to user with email & password" do | 47 | it "should send valid email to user with email & password" do |
| 48 | - click_button "Save" | 48 | + with_resque do |
| 49 | + click_button "Save" | ||
| 50 | + end | ||
| 49 | user = User.last | 51 | user = User.last |
| 50 | email = ActionMailer::Base.deliveries.last | 52 | email = ActionMailer::Base.deliveries.last |
| 51 | email.subject.should have_content("Account was created") | 53 | email.subject.should have_content("Account was created") |
spec/requests/issues_spec.rb
| @@ -133,7 +133,9 @@ describe "Issues" do | @@ -133,7 +133,9 @@ describe "Issues" do | ||
| 133 | end | 133 | end |
| 134 | 134 | ||
| 135 | it "should send valid email to user" do | 135 | it "should send valid email to user" do |
| 136 | - click_button "Submit new issue" | 136 | + with_resque do |
| 137 | + click_button "Submit new issue" | ||
| 138 | + end | ||
| 137 | issue = Issue.last | 139 | issue = Issue.last |
| 138 | email = ActionMailer::Base.deliveries.last | 140 | email = ActionMailer::Base.deliveries.last |
| 139 | email.subject.should have_content("New Issue was created") | 141 | email.subject.should have_content("New Issue was created") |