Skip to content

Commit 6bcf49a

Browse files
committed
Added more specs
1 parent 91cc781 commit 6bcf49a

3 files changed

Lines changed: 28 additions & 1 deletion

File tree

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ GEM
8888
erubis (2.7.0)
8989
execjs (1.3.0)
9090
multi_json (~> 1.0)
91-
fabrication (1.2.0)
91+
fabrication (2.8.1)
9292
faker (1.0.1)
9393
i18n (~> 0.4)
9494
ffi (1.0.11)

spec/controllers/mailer_controller_spec.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
describe MailerController do
44
let(:user) { Fabricate(:user) }
5+
let(:users) { Fabricate.sequence(:user, 5)}
56

67
describe "GET 'new' for a single user email" do
78
it "returns http success" do
@@ -10,4 +11,24 @@
1011
end
1112
end
1213

14+
describe "GET 'new' for a diffusion" do
15+
it "returns http success" do
16+
get 'new', user: Array(users)
17+
response.should be_success
18+
end
19+
end
20+
21+
describe "POST 'create' for a single user email" do
22+
it "returns http success" do
23+
get 'create', message: Fabricate.build(:message)
24+
response.should be_success
25+
end
26+
end
27+
28+
describe "POST 'create' for a diffusion" do
29+
it "returns http success" do
30+
post 'create', message: Fabricate.build(:diffusion)
31+
response.should be_success
32+
end
33+
end
1334
end

spec/fabricators/message_fabricator.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
subject:"Hackety-hack email"
44
body:"This is an email from hackety-hack.com"
55
end
6+
7+
Fabricator(:diffusion, from: :message) do
8+
email(count: 5) { |i| "proof#{i}@example.com" }
9+
subject:"Hackety-hack email"
10+
body:"This is an email from hackety-hack.com"
11+
end

0 commit comments

Comments
 (0)