wagn 1.14.8 → 1.14.9

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: d41c9e082ba7d54cafd997a24bbe890372884708
4
- data.tar.gz: 4acdb3fad920ab7e4aea3b4d019ae8c7ef9af47c
3
+ metadata.gz: f6e661b341c8a71e483cd218c80a8b2e20033d0b
4
+ data.tar.gz: bf400c1756544a093fb3a1f9c2bc40d23bd19888
5
5
  SHA512:
6
- metadata.gz: ca2ec51091c1d0349fcff8f7f0eb879fbf160e3a468599b40aa7cf9a6c26b9c0388015e6f39f73aa04f7e76a8e83fa8b46752f9c58641b9f292d3ffa1390b8e5
7
- data.tar.gz: 577f21513149a3600d5bc250fec0cad97318877492441590113b46844077f6ad3188943c673476afa642da3a74b17904dc434c0fb86c8a7d6053e9abda56fb79
6
+ metadata.gz: c13311a967f128a8684e2c8eae810ac4386ae2e07320f0d567bfded8168c1981eca877d3c4a30301553685daaa0ff4070b7a0bd1f43ba27821b16efca39bc063
7
+ data.tar.gz: 42eccd892969a798788f4a1e0dbe5fe79a6af5815e0f659851795a2abef22a3b83b31f8e6d946bdd6889dcfd76a4b2f4a6a1a58efeecf8c21050ba0a5f16555e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.14.8
1
+ 1.14.9
@@ -16,7 +16,7 @@ def content=(value)
16
16
  end
17
17
 
18
18
  def raw_content
19
- structure ? template.db_content : db_content
19
+ structure ? template.db_content : content
20
20
  end
21
21
 
22
22
 
@@ -54,8 +54,11 @@ module ClassMethods
54
54
  if card.new_card?
55
55
  if opts[:new]
56
56
  return card.renew(opts) if !clean_cache_opts? opts
57
+ elsif opts[:skip_virtual]
58
+ return
57
59
  else
58
- return unless !opts[:skip_virtual] && card.virtual?
60
+ card.include_set_modules unless opts[:skip_modules] # need to load modules here to call the right virtual? method
61
+ return unless card.virtual?
59
62
  end
60
63
  card.name = mark.to_s if mark && mark.to_s != card.name
61
64
  end
@@ -57,6 +57,7 @@ describe Card::Set::All::Templating do
57
57
  Card::Auth.as_bot do
58
58
  @bt = Card.create! :name=>"birthday+*right+*default", :type=>'Date', :content=>"Today!"
59
59
  end
60
+ @bb = Card.new :name=>'Bob+birthday'
60
61
  @jb = Card.create! :name=>"Jim+birthday"
61
62
  end
62
63
 
@@ -69,7 +70,9 @@ describe Card::Set::All::Templating do
69
70
  end
70
71
 
71
72
  it "should apply to new cards" do
72
- expect(Card.new(:name=>"Pete+birthday").content).to eq('Today!')
73
+ pb = Card.new :name=>"Pete+birthday"
74
+ expect(pb.raw_content).to eq('Today!')
75
+ expect(pb.content).to eq('Today!')
73
76
  end
74
77
  end
75
78
 
@@ -1,16 +1,13 @@
1
- include Card::Set::Type::Css
1
+ include Type::Css
2
2
 
3
- format :html do
4
- view :core, :mod=>Css::HtmlFormat
5
- view :editor, :mod=>PlainText::HtmlFormat
6
- view :content_changes, :mod=>CoffeeScript::HtmlFormat
7
- end
8
-
9
3
  def diff_args
10
4
  {:format=>:text}
11
5
  end
12
6
 
7
+
13
8
  format do
9
+ include Css::Format
10
+
14
11
  view :core do |args|
15
12
  process_content compile_scss(_render_raw)
16
13
  end
@@ -21,7 +18,6 @@ format do
21
18
  e
22
19
  end
23
20
 
24
-
25
21
  end
26
22
 
27
-
23
+ format( :html ) { include Css::HtmlFormat }
@@ -11,6 +11,7 @@ describe Card::Set::Type::Css do
11
11
  assert_view_select css_card.format.render_core, 'div[class=CodeRay]'
12
12
  end
13
13
  end
14
+
14
15
 
15
16
  it_behaves_like "machine input" do
16
17
  let(:create_machine_input_card) { Card.gimme! "test css", :type => :css, :content => css }
@@ -38,6 +38,14 @@ describe Card::Set::Type::Scss do
38
38
  end
39
39
  end
40
40
 
41
+ it "should process links and inclusions but not urls" do
42
+ Card::Auth.as_bot do
43
+ scss = ".TYPE-X.no-citations {\n color: #BA5B5B;\n}\n"
44
+ card = Card.create! :name=>'minimal css', :type=>'scss', :content=>scss
45
+ card.format(:css).render_core.should == scss
46
+ end
47
+ end
48
+
41
49
  it_should_behave_like 'content machine', that_produces_css do
42
50
  let(:machine_card) { Card.gimme! "test scss", :type => :scss, :content => scss }
43
51
  let(:card_content) do
@@ -23,6 +23,8 @@ format :email_text do
23
23
  view :email_addresses do |args|
24
24
  context = args[:context] || self
25
25
  card.item_names(:context=>context.cardname).map do |item_name|
26
+ # note that context is processed twice here because pointers absolutize item_names by default
27
+ # while other types can return relative names. That's poor default behavior and should be fixed!
26
28
  item_name = item_name.to_name.to_absolute(context).to_s
27
29
  if item_name.match /.+\@.+\..+/
28
30
  item_name
@@ -58,8 +58,8 @@ def email_config args={}
58
58
  if default_from=Card::Mailer.default[:from]
59
59
  config[:from] = from_email ? "#{from_name || from_email} <#{default_from}>" : default_from
60
60
  config[:reply_to] ||= config[:from]
61
- else
62
- config[:from] ||= Card[Card::WagnBotID].account.email
61
+ elsif config[:from].blank?
62
+ config[:from] = Card[Card::WagnBotID].account.email
63
63
  end
64
64
  config.select {|k,v| v.present? }
65
65
  end
@@ -25,7 +25,7 @@ end
25
25
 
26
26
  format do
27
27
  view :verify_url do |args|
28
- wagn_url "/update/#{card.cardname.left_name.url_key}?token=#{card.token}"
28
+ wagn_url "update/#{card.cardname.left_name.url_key}?token=#{card.token}"
29
29
  end
30
30
 
31
31
  view :verify_days do |args|
@@ -33,7 +33,7 @@ format do
33
33
  end
34
34
 
35
35
  view :reset_password_url do |args|
36
- wagn_url "/update/#{card.cardname.url_key}?reset_token=#{card.token_card.refresh(true).content}"
36
+ wagn_url "update/#{card.cardname.url_key}?reset_token=#{card.token_card.refresh(true).content}"
37
37
  end
38
38
 
39
39
  view :reset_password_days do |args|
@@ -128,6 +128,12 @@ event :reset_token do
128
128
  end
129
129
 
130
130
 
131
+ event :send_welcome_email do
132
+ if ((welcome = Card['welcome email']) && welcome.type_code == :email_template)
133
+ welcome.deliver(:context=>left, :to=>self.email)
134
+ end
135
+ end
136
+
131
137
  event :send_account_verification_email, :on=>:create, :after=>:extend, :when=>proc{ |c| c.token.present? } do
132
138
  Card[:verification_email].deliver( :context => self, :to => self.email )
133
139
  end
@@ -98,6 +98,7 @@ end
98
98
  event :activate_account do
99
99
  subcards['+*account'] = {'+*status'=>'active'}
100
100
  self.type_id = Card.default_accounted_type_id
101
+ account.send_welcome_email
101
102
  end
102
103
 
103
104
  event :approve_with_token, :on=>:update, :before=>:approve, :when=>proc {|c| Env.params[:approve_with_token] } do
@@ -83,7 +83,6 @@ describe Card::Set::Type::Signup do
83
83
  success = Card::Env.params[:success]
84
84
  expect(success[:message]).to match(/expired/) # user notified of expired token
85
85
  end
86
-
87
86
  end
88
87
 
89
88
 
@@ -121,7 +120,7 @@ describe Card::Set::Type::Signup do
121
120
 
122
121
  end
123
122
 
124
- it 'deos not send verification email' do
123
+ it 'does not send verification email' do
125
124
  expect(Mail::TestMailer.deliveries[-2]).to be_nil
126
125
  end
127
126
 
@@ -155,6 +154,26 @@ describe Card::Set::Type::Signup do
155
154
 
156
155
  end
157
156
 
157
+ context 'a welcome email card exists' do
158
+ before do
159
+ Card::Auth.as_bot do
160
+ Card.create! :name=>'welcome email', :subcards=>{'+*subject'=>'welcome',
161
+ '+*html_message'=>'Welcome {{_self|name}}'}, :type_id=>Card::EmailTemplateID
162
+ end
163
+ Mail::TestMailer.deliveries.clear
164
+ @signup = Card.create! :name=>'Big Bad Sheep', :type_id=>Card::SignupID,
165
+ '+*account'=>{'+*email'=>'sheep@wagn.org', '+*password'=>'sheep'}
166
+
167
+ end
168
+ it 'sends welcome email when account is activated' do
169
+ @signup.activate_account
170
+ @mail = ActionMailer::Base.deliveries.find{ |a| a.subject == 'welcome' }
171
+ Mail::TestMailer.deliveries.clear
172
+
173
+ expect(@mail).to be_truthy
174
+ expect(@mail.body.raw_source ).to include('Welcome Big Bad Sheep')
175
+ end
176
+ end
158
177
 
159
178
  context 'invitation' do
160
179
  before do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wagn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.8
4
+ version: 1.14.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-11 00:00:00.000000000 Z
13
+ date: 2015-02-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails