Skip to content

Commit

Permalink
subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Nov 6, 2018
1 parent 380b5a0 commit 2a9969c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
14 changes: 7 additions & 7 deletions Gemfile.lock
Expand Up @@ -32,7 +32,7 @@ GEM
url
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.0.5)
concurrent-ruby (1.1.1)
crass (1.0.4)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
Expand Down Expand Up @@ -64,12 +64,12 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.2.2)
loofah (2.2.3)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
method_source (0.9.0)
method_source (0.9.1)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
Expand All @@ -79,11 +79,11 @@ GEM
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
parallel (1.12.1)
parser (2.5.1.2)
parser (2.5.3.0)
ast (~> 2.4.0)
pg (1.1.3)
powerpack (0.1.2)
rack (2.0.5)
rack (2.0.6)
rack-protection (2.0.4)
rack
rack-ssl (1.4.1)
Expand Down Expand Up @@ -135,8 +135,8 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.4.0)
rubocop-rspec (1.30.0)
rubocop (>= 0.58.0)
rubocop-rspec (1.30.1)
rubocop (>= 0.60.0)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
sass (3.6.0)
Expand Down
3 changes: 3 additions & 0 deletions test/test_mailanes.rb
Expand Up @@ -124,6 +124,9 @@ def test_some_pages
assert_equal(200, last_response.status, last_response.body)
get("/lane?id=#{lane.id}")
assert_equal(200, last_response.status, last_response.body)
letter = Letters.new(lane: lane).add
get("/letter?id=#{letter.id}")
assert_equal(200, last_response.status, last_response.body)
campaign = Campaigns.new(owner: owner).add(list, lane)
get('/campaigns')
assert_equal(200, last_response.status, last_response.body)
Expand Down
4 changes: 2 additions & 2 deletions views/letter.haml
Expand Up @@ -3,7 +3,7 @@
= "##{letter.id}:"
= letter.title

- if !letter.liquid.include?('{{unsubscribe}}', '{{unsubscribe_query}}')
- if !letter.liquid.include?('{{unsubscribe}}') && !letter.liquid.include?('{{unsubscribe_query}}')
%p.red
The Liquid template doesn't have the {{unsubsribe}} link!

Expand Down Expand Up @@ -68,7 +68,7 @@
- else
%span.red not active
= '/'
%a{href: "/toggle-letter?id=#{letter.id}", onclick: (letter.liquid.include?('{{unsubscribe}}', '{{unsubscribe_query}}') ? '' : "return confirm('There is no UNSUBSCRIBE link, are you sure?')")}<
%a{href: "/toggle-letter?id=#{letter.id}", onclick: (letter.liquid.include?('{{unsubscribe}}') && letter.liquid.include?('{{unsubscribe_query}}') ? '' : "return confirm('There is no UNSUBSCRIBE link, are you sure?')")}<
- if letter.active?
deactivate
- else
Expand Down

0 comments on commit 2a9969c

Please sign in to comment.