maily 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Maily
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/maily.png)](http://badge.fury.io/rb/maily) [![Build Status](https://travis-ci.org/markets/maily.png?branch=master)](https://travis-ci.org/markets/maily)
3
+ [![Gem Version](https://badge.fury.io/rb/maily.svg)](http://badge.fury.io/rb/maily) [![Build Status](https://travis-ci.org/markets/maily.svg?branch=master)](https://travis-ci.org/markets/maily)
4
4
 
5
5
  Stop to delivery emails every time you change it!
6
6
 
@@ -1 +1,5 @@
1
1
  //= require_tree .
2
+
3
+ function resizeIframe(obj) {
4
+ obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
5
+ }
@@ -44,9 +44,7 @@ body {
44
44
  }
45
45
  }
46
46
 
47
- .title {
48
- margin-top: 0;
49
- }
47
+ .title { margin-top: 0; }
50
48
 
51
49
 
52
50
  header.header, footer.footer {
@@ -92,6 +90,7 @@ footer.footer {
92
90
  .wrap_content {
93
91
  display: inline-block;
94
92
  box-sizing: border-box;
93
+ -moz-box-sizing: border-box;
95
94
  padding: 6em .75em 4em;
96
95
  width: 100%;
97
96
  }
@@ -152,6 +151,7 @@ footer.footer {
152
151
  .maily_mail_preview {
153
152
  height: 100%;
154
153
  box-sizing: border-box;
154
+ -moz-box-sizing: border-box;
155
155
  padding: 1em;
156
156
  border: solid 1px #ccc;
157
157
  border-radius: 3px;
@@ -205,6 +205,7 @@ footer.footer {
205
205
 
206
206
  .maily_button {
207
207
  box-sizing: border-box;
208
+ -moz-box-sizing: border-box;
208
209
  padding: 0;
209
210
  border: none;
210
211
  background: none;
@@ -47,9 +47,8 @@
47
47
  <% end %>
48
48
 
49
49
  <% if @email.html_part || @email.text_part || @email.body.present? %>
50
- <iframe class="maily_preview" src="<%= raw_maily_email_path(mailer: params[:mailer], email: params[:email], locale: params[:locale], part: params[:part]) %>" frameborder="1" height="100%" width="100%"></iframe>
50
+ <iframe class="maily_preview" onload='javascript:resizeIframe(this);' src="<%= raw_maily_email_path(mailer: params[:mailer], email: params[:email], locale: params[:locale], part: params[:part]) %>" frameborder="1" width="100%"></iframe>
51
51
  <% end %>
52
-
53
52
  <% if @email.attachments.present? %>
54
53
  <ul class="maily_mail_attachments">
55
54
  <li>Attachments:</li>
data/lib/maily/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Maily
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
data/spec/email_spec.rb CHANGED
@@ -4,11 +4,15 @@ describe Maily::Email do
4
4
  let(:mailer) { Maily::Mailer.find('notifier') }
5
5
 
6
6
  context "with no arguments" do
7
+ let (:email) { mailer.find_email('welcome') }
8
+
7
9
  it "should not require hook" do
8
- email = mailer.find_email('welcome')
10
+ expect(email.required_arguments).to be_blank
11
+ expect(email.require_hook?).to be_false
12
+ end
9
13
 
10
- email.required_arguments.should be_blank
11
- email.require_hook?.should be_false
14
+ it ".call" do
15
+ expect { email.call }.to_not raise_error
12
16
  end
13
17
  end
14
18
 
@@ -16,18 +20,22 @@ describe Maily::Email do
16
20
  let (:email) { mailer.find_email('invitation') }
17
21
 
18
22
  it "should require hook" do
19
- email.required_arguments.should be_present
20
- email.require_hook?.should be_true
23
+ expect(email.required_arguments).to be_present
24
+ expect(email.require_hook?).to be_true
21
25
  end
22
26
 
23
27
  it "should handle arguments successfully" do
24
- email.arguments.size.should == 1
28
+ expect(email.arguments).to be_present
29
+ expect(email.arguments.size).to eq(email.required_arguments.size)
30
+ end
31
+
32
+ it ".call" do
25
33
  expect { email.call }.to_not raise_error
26
34
  end
27
35
  end
28
36
 
29
37
  it "should handle template_path via hook" do
30
38
  email = mailer.find_email('recommendation')
31
- email.template_path.should == 'notifications'
39
+ expect(email.template_path).to eq('notifications')
32
40
  end
33
41
  end
data/spec/mailer_spec.rb CHANGED
@@ -2,20 +2,20 @@ require 'spec_helper'
2
2
 
3
3
  describe Maily::Mailer do
4
4
  it "should load mailers" do
5
- Maily::Mailer.all.size.should == 1
5
+ expect(Maily::Mailer.all.size).to eq(1)
6
6
  end
7
7
 
8
8
  it "should build emails" do
9
9
  mailer = Maily::Mailer.find('notifier')
10
- mailer.emails.size.should == 3
10
+ expect(mailer.emails.size).to eq(3)
11
11
  end
12
12
 
13
13
  it "should find mailers by name" do
14
- Maily::Mailer.find('notifier').name.should == 'notifier'
14
+ expect(Maily::Mailer.find('notifier').name).to eq('notifier')
15
15
  end
16
16
 
17
17
  it "should find emails by name" do
18
18
  mailer = Maily::Mailer.find('notifier')
19
- mailer.find_email('welcome').name.should == 'welcome'
19
+ expect(mailer.find_email('welcome').name).to eq('welcome')
20
20
  end
21
21
  end
data/spec/maily_spec.rb CHANGED
@@ -4,23 +4,23 @@ describe Maily do
4
4
  it "should set up with defaults if no block provided" do
5
5
  Maily.setup
6
6
 
7
- Maily.enabled.should be_true
8
- Maily.allow_edition.should be_true
9
- Maily.allow_delivery.should be_true
10
- Maily.available_locales.should == I18n.available_locales
11
- Maily.base_controller.should == 'ActionController::Base'
7
+ expect(Maily.enabled).to be_true
8
+ expect(Maily.allow_edition).to be_true
9
+ expect(Maily.allow_delivery).to be_true
10
+ expect(Maily.available_locales).to eq(I18n.available_locales)
11
+ expect(Maily.base_controller).to eq('ActionController::Base')
12
12
  end
13
13
 
14
14
  it "should not allow edition if edition is disabled" do
15
15
  Maily.allow_edition = false
16
16
 
17
- Maily.allowed_action?(:edit).should be_false
18
- Maily.allowed_action?(:update).should be_false
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
- Maily.allowed_action?(:deliver).should be_false
24
+ expect(Maily.allowed_action?(:deliver)).to be_false
25
25
  end
26
26
  end
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.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-09 00:00:00.000000000 Z
12
+ date: 2014-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -148,12 +148,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
148
  - - ! '>='
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
+ segments:
152
+ - 0
153
+ hash: -4181981977769088006
151
154
  required_rubygems_version: !ruby/object:Gem::Requirement
152
155
  none: false
153
156
  requirements:
154
157
  - - ! '>='
155
158
  - !ruby/object:Gem::Version
156
159
  version: '0'
160
+ segments:
161
+ - 0
162
+ hash: -4181981977769088006
157
163
  requirements: []
158
164
  rubyforge_project:
159
165
  rubygems_version: 1.8.23