rails_email_preview 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 52a17e3d36b0d7cf89ee5d5cd203f46c24710a36
4
- data.tar.gz: 3e80c0aa0452d9048e2325e2fb16fd18aa0ac32a
3
+ metadata.gz: 29c1a27975a3c37570a310cd5fd8fab3efa66c28
4
+ data.tar.gz: 254f09df4a0fe63b6e16c6f77d30fcea0fb0cada
5
5
  SHA512:
6
- metadata.gz: 0f33ae9252698108f4e03fb383239d777e96fad40abbf390f1fdfda54fbed1d54f95c2935c002386444d0d8270655a18326f5ed14b385d2b1a3a6925b579abc4
7
- data.tar.gz: 59faa202e37281f126da6813783b6297267b4d3b5ae9f09bcaa7ba875f6000a467aa3654b8d632a57fbd093c1d54c75613bc723621e2bc30918bdc953475f8c5
6
+ metadata.gz: 12ed93d3d7351dae246a430f2fd06ed69e9a6262b0d2dee452e8f2d24816ce3da2cc4f2e7057dd2feb3c08aa23712beff13107563c0325462b6d7bd79a3529c6
7
+ data.tar.gz: 65ca94712efcebb5e8200a7784831f73f6782dd15b0f0b8e2737e22c4cfbfa6a4f2b707942e0da9152d7441b089614eac2f5415734828dae1e04d1c1fd964003
data/README.md CHANGED
@@ -12,20 +12,19 @@ How to
12
12
 
13
13
  Add to Gemfile
14
14
 
15
- gem 'rails_email_preview'
15
+ gem 'rails_email_preview', '~> 0.1.7'
16
16
 
17
- Run generators
17
+ REP handles setup for you:
18
18
 
19
- # Add initializer and route
20
- rails g rails_email_preview:install
19
+ # adds initializer and route:
20
+ rails g rails_email_preview:install
21
21
 
22
- # Generate preview classes and method stubs in app/mailer_previews/
23
- rails g rails_email_preview:update_previews
22
+ # generates preview classes and method stubs in app/mailer_previews/:
23
+ rails g rails_email_preview:update_previews
24
24
 
25
- You will need to provide data for preview of each email:
25
+ This last generator will add a stub for each of your emails, then you populate the stubs with mock data:
26
26
 
27
- # Say there is a UserMailer with 2 actions
28
- # in app/mailer_previews/user_mailer_preview.rb initialize the emails for preview:
27
+ # app/mailer_previews/user_mailer_preview.rb:
29
28
  class UserMailerPreview
30
29
  # preview methods should return Mail objects, e.g.:
31
30
  def invitation
@@ -38,12 +37,13 @@ You will need to provide data for preview of each email:
38
37
 
39
38
  private
40
39
  # You can put all your mock helpers in a module
41
- # Or, if you have factories/fabricators for your tests you could use those, but be careful not to create anything!
40
+ # or you can use your factories / fabricators, just make sure you are not creating anythin
42
41
  def mock_user(name = 'Bill Gates')
43
42
  fake_id User.new(name: name, email: "user#{rand 100}@test.com")
44
43
  end
45
-
44
+
46
45
  def fake_id(obj)
46
+ # overrides the method on just this object
47
47
  obj.define_singleton_method(:id) { 123 + rand(100) }
48
48
  obj
49
49
  end
@@ -1,3 +1,3 @@
1
1
  module RailsEmailPreview
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_email_preview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: slim-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: sass
57
71
  requirement: !ruby/object:Gem::Requirement