letter_bomb 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -16
- data/app/controllers/letter_bomb/mailers_controller.rb +7 -30
- data/app/views/letter_bomb/mailers/index.html.erb +4 -4
- data/app/views/letter_bomb/mailers/show.html.erb +14 -27
- data/lib/letter_bomb/preview.rb +65 -26
- data/lib/letter_bomb/version.rb +1 -1
- data/spec/dummy/app/mailers/foo_mailer_preview.rb +11 -1
- data/spec/dummy/log/development.log +3580 -0
- data/spec/dummy/log/test.log +889 -0
- data/spec/lib/letter_bomb/preview_spec.rb +11 -35
- data/spec/spec_helper.rb +0 -1
- metadata +2 -2
@@ -1,16 +1,15 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe LetterBomb::Preview do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
LetterBomb::Preview.previews.should include FooMailerPreview
|
4
|
+
describe ".classes" do
|
5
|
+
it "returns a list of classes within app/mailers suffixed with preview" do
|
6
|
+
expect(LetterBomb::Preview.classes).to include(FooMailerPreview)
|
8
7
|
end
|
9
8
|
end
|
10
9
|
|
11
|
-
describe ".
|
10
|
+
describe ".actions" do
|
12
11
|
it "returns an alphabetized list of public instance methods" do
|
13
|
-
FooMailerPreview.
|
12
|
+
expect(FooMailerPreview.actions).to eq(['bad', 'good'])
|
14
13
|
end
|
15
14
|
end
|
16
15
|
|
@@ -21,35 +20,12 @@ describe LetterBomb::Preview do
|
|
21
20
|
end.to_not change { User.count }
|
22
21
|
end
|
23
22
|
|
24
|
-
it "returns
|
25
|
-
FooMailerPreview.preview_action(:good)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
describe ".has_factory_girl" do
|
30
|
-
it "requires FactoryGirl on preview initialization" do
|
31
|
-
class FactoryPreview < LetterBomb::Preview; has_factory_girl; end
|
23
|
+
it "returns a Preview::Action for the Mail object" do
|
24
|
+
action = FooMailerPreview.preview_action(:good)
|
32
25
|
|
33
|
-
|
34
|
-
|
35
|
-
|
26
|
+
# TODO using #send makes writing a mock expectation tricky
|
27
|
+
expect(action.name).to eq(:good)
|
28
|
+
expect(action).to be_a(LetterBomb::Preview::Action)
|
36
29
|
end
|
37
30
|
end
|
38
|
-
|
39
|
-
describe "#lchomp" do
|
40
|
-
it "removes a given string from the start of a target string" do
|
41
|
-
LetterBomb::Preview.lchomp('abcd/edfg/abcd', 'abcd').should == '/edfg/abcd'
|
42
|
-
end
|
43
|
-
context "when the target string does not begin with the removable string" do
|
44
|
-
it "returns the target string" do
|
45
|
-
LetterBomb::Preview.lchomp('edfg/abcd', 'abcd').should == 'edfg/abcd'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
context "when the target string does not contain the removable string" do
|
49
|
-
it "returns the target string" do
|
50
|
-
LetterBomb::Preview.lchomp('edfg', 'abcd').should == 'edfg'
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
31
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: letter_bomb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|