maily 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/lib/maily.rb +1 -1
- data/lib/maily/version.rb +1 -1
- data/spec/dummy/README.md +2 -2
- data/spec/email_spec.rb +2 -2
- data/spec/maily_spec.rb +6 -6
- data/spec/spec_helper.rb +1 -0
- metadata +3 -3
data/README.md
CHANGED
@@ -81,7 +81,7 @@ Most of emails need to populate data to consume it and do intersting things. Hoo
|
|
81
81
|
# lib/maily_hooks.rb
|
82
82
|
user = User.new(email: 'user@example.com')
|
83
83
|
comment = Struct.new(:body).new('Lorem ipsum') # stub way
|
84
|
-
service =
|
84
|
+
service = FactoryGirl.create(:service) # using fixtures with FactoryGirl
|
85
85
|
|
86
86
|
Maily.hooks_for('Notifier') do |mailer|
|
87
87
|
mailer.register_hook(:welcome, user, template_path: 'users')
|
@@ -121,7 +121,7 @@ class AdminController < ActionController::Base
|
|
121
121
|
private
|
122
122
|
|
123
123
|
def maily_authorized?
|
124
|
-
(current_user && current_user.admin?) || raise(
|
124
|
+
(current_user && current_user.admin?) || raise("You don't have access to this section!")
|
125
125
|
end
|
126
126
|
end
|
127
127
|
```
|
@@ -129,7 +129,7 @@ end
|
|
129
129
|
## Notes
|
130
130
|
Rails 4.1 introduced a built-in mechanism to preview the application emails. It is in fact a port of [basecamp/mail_view](https://github.com/basecamp/mail_view) gem to the core.
|
131
131
|
|
132
|
-
Alternatively, there are some other plugins to get a similar functionality with different approaches and options. For example, [ryanb/letter_opener](https://github.com/ryanb/letter_opener), [
|
132
|
+
Alternatively, there are some other plugins to get a similar functionality with different approaches and options. For example, [ryanb/letter_opener](https://github.com/ryanb/letter_opener), [sj26/mailcatcher](https://github.com/sj26/mailcatcher) or [glebm/rails_email_preview](https://github.com/glebm/rails_email_preview).
|
133
133
|
|
134
134
|
## License
|
135
135
|
Copyright (c) 2013-2014 Marc Anguera. Maily is released under the [MIT](MIT-LICENSE) License.
|
data/lib/maily.rb
CHANGED
data/lib/maily/version.rb
CHANGED
data/spec/dummy/README.md
CHANGED
data/spec/email_spec.rb
CHANGED
@@ -8,7 +8,7 @@ describe Maily::Email do
|
|
8
8
|
|
9
9
|
it "should not require hook" do
|
10
10
|
expect(email.required_arguments).to be_blank
|
11
|
-
expect(email.require_hook?).to
|
11
|
+
expect(email.require_hook?).to be false
|
12
12
|
end
|
13
13
|
|
14
14
|
it ".call" do
|
@@ -21,7 +21,7 @@ describe Maily::Email do
|
|
21
21
|
|
22
22
|
it "should require hook" do
|
23
23
|
expect(email.required_arguments).to be_present
|
24
|
-
expect(email.require_hook?).to
|
24
|
+
expect(email.require_hook?).to be true
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should handle arguments successfully" do
|
data/spec/maily_spec.rb
CHANGED
@@ -4,9 +4,9 @@ describe Maily do
|
|
4
4
|
it "should set up with defaults if no block provided" do
|
5
5
|
Maily.setup
|
6
6
|
|
7
|
-
expect(Maily.enabled).to
|
8
|
-
expect(Maily.allow_edition).to
|
9
|
-
expect(Maily.allow_delivery).to
|
7
|
+
expect(Maily.enabled).to be true
|
8
|
+
expect(Maily.allow_edition).to be true
|
9
|
+
expect(Maily.allow_delivery).to be true
|
10
10
|
expect(Maily.available_locales).to eq(I18n.available_locales)
|
11
11
|
expect(Maily.base_controller).to eq('ActionController::Base')
|
12
12
|
end
|
@@ -14,13 +14,13 @@ describe Maily do
|
|
14
14
|
it "should not allow edition if edition is disabled" do
|
15
15
|
Maily.allow_edition = false
|
16
16
|
|
17
|
-
expect(Maily.allowed_action?(:edit)).to
|
18
|
-
expect(Maily.allowed_action?(:update)).to
|
17
|
+
expect(Maily.allowed_action?(:edit)).to be false
|
18
|
+
expect(Maily.allowed_action?(:update)).to be false
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should not allow delivery if delivery is disabled" do
|
22
22
|
Maily.allow_delivery = false
|
23
23
|
|
24
|
-
expect(Maily.allowed_action?(:deliver)).to
|
24
|
+
expect(Maily.allowed_action?(:deliver)).to be false
|
25
25
|
end
|
26
26
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maily
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -151,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
segments:
|
153
153
|
- 0
|
154
|
-
hash:
|
154
|
+
hash: 3711050222606402912
|
155
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
156
|
none: false
|
157
157
|
requirements:
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
segments:
|
162
162
|
- 0
|
163
|
-
hash:
|
163
|
+
hash: 3711050222606402912
|
164
164
|
requirements: []
|
165
165
|
rubyforge_project:
|
166
166
|
rubygems_version: 1.8.23
|