Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit f39449e

Browse files
author
caleb
committed
small fixture changes, worked on testing of mailer.
git-svn-id: http://svn.pdxruby.org/repos/www/trunk@208 f0fbaf97-c700-0410-a5eb-8ea856f8537e
1 parent 360cccb commit f39449e

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

app/controllers/events_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def update
8484
end
8585
if @event.update_attributes(params[:event])
8686
flash[:notice] = 'Event was successfully updated.'
87-
MailBot::deliver_change_message(self, @event) unless params[:trivial]
87+
MailBot::deliver_change_message(self, @event) if params[:trivial].nil?
8888
redirect_to :action => 'show', :id => @event
8989
else
9090
render :action => 'edit'

test/fixtures/members.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ bob:
22
id: 1
33
name: Bob
44
5-
password: <%= Digest::MD5.hexdigest('abc') %>
5+
password: <%= Digest::SHA1.hexdigest('abc') %>
66
feed_url: http://foo/bar
77
about: something
88
created_at: <%= Time.now %>
@@ -11,7 +11,16 @@ sue:
1111
id: 2
1212
name: Sue
1313
14-
password: <%= Digest::MD5.hexdigest('abc') %>
14+
password: <%= Digest::SHA1.hexdigest('abc') %>
1515
feed_url: http://foo/bar
1616
about: something
1717
created_at: <%= Time.now %>
18+
19+
aaron:
20+
id: 3
21+
name: Aaron
22+
23+
password: <%= Digest::SHA1.hexdigest('abc') %>
24+
feed_url: http://foo/bar
25+
about: something
26+
created_at: <%= Time.now - 5000 %>

test/fixtures/participants.yml

+6
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ another:
99
member_id: 2
1010
event_id: 2
1111
attending: no
12+
13+
one_more:
14+
id: 3
15+
member_id: 3
16+
event_id: 2
17+
attending: yes

test/functional/events_controller_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ def setup_for_mail_tests
9494

9595
def test_trivial_change
9696
setup_for_mail_tests
97+
@request.session[:member] = 1
9798
post :update, {"commit"=>"Edit", "event"=>{"minutes"=>"Testing this stupid thing. Dont Send mail."}, "action"=>"update", "id"=>"1", "controller"=>"events", "trivial"=>"1"}
9899
assert ActionMailer::Base.deliveries.empty?
99100
end
101+
100102
end

0 commit comments

Comments
 (0)