link_to_action 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/test/helpers_test.rb CHANGED
@@ -43,9 +43,42 @@ class HelperTest < ActionView::TestCase
43
43
  end
44
44
 
45
45
  test 'link_to_destroy' do
46
- assert_equal "<a href=\"/users/1\" data-confirm=\"Are you sure?\" data-method=\"delete\" data-skip-pjax=\"true\" rel=\"nofollow\">Delete My User</a>",
46
+ assert_equal "<a href=\"/users/1\" data-confirm=\"Are you sure?\" data-method=\"delete\" rel=\"nofollow\">Delete My User</a>",
47
47
  link_to_destroy(@user)
48
48
  end
49
+
50
+ test 'link_to_destroy with skip_pjax' do
51
+ swap LinkToAction, destroy_skip_pjax: true do
52
+ assert_equal "<a href=\"/users/1\" data-confirm=\"Are you sure?\" data-method=\"delete\" data-skip-pjax=\"true\" rel=\"nofollow\">Delete My User</a>",
53
+ link_to_destroy(@user)
54
+ end
55
+ end
56
+
57
+ test 'link_to_destroy without confirm' do
58
+ swap LinkToAction, destroy_confirm: false do
59
+ assert_equal "<a href=\"/users/1\" data-method=\"delete\" rel=\"nofollow\">Delete My User</a>",
60
+ link_to_destroy(@user)
61
+ end
62
+ end
63
+
64
+ test 'link_to_destroy with per-link confirm' do
65
+ swap LinkToAction, destroy_confirm: false do
66
+ assert_equal "<a href=\"/users/1\" data-confirm=\"Are you sure?\" data-method=\"delete\" rel=\"nofollow\">Delete My User</a>",
67
+ link_to_destroy(@user, confirm: true)
68
+ end
69
+ end
70
+
71
+ test 'link_to_destroy with per-link confirm and specific text' do
72
+ swap LinkToAction, destroy_confirm: false do
73
+ assert_equal "<a href=\"/users/1\" data-confirm=\"Are you really sure?\" data-method=\"delete\" rel=\"nofollow\">Delete My User</a>",
74
+ link_to_destroy(@user, confirm: 'Are you really sure?')
75
+ end
76
+ end
77
+
78
+ test 'link_to_destroy without per-link confirm' do
79
+ assert_equal "<a href=\"/users/1\" data-method=\"delete\" rel=\"nofollow\">Delete My User</a>",
80
+ link_to_destroy(@user, confirm: false)
81
+ end
49
82
 
50
83
  test 'link_to_destroy with cancan disallowed' do
51
84
  swap LinkToAction, use_cancan: true do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: link_to_action
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
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: 2012-10-05 00:00:00.000000000 Z
12
+ date: 2012-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -94,6 +94,7 @@ files:
94
94
  - lib/link_to_action.rb
95
95
  - lib/link_to_action/helpers.rb
96
96
  - lib/link_to_action/locale/en.yml
97
+ - lib/link_to_action/utils.rb
97
98
  - lib/link_to_action/version.rb
98
99
  - link_to_action.gemspec
99
100
  - test/default_values_test.rb
@@ -157,7 +158,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
158
  version: '0'
158
159
  segments:
159
160
  - 0
160
- hash: -2659013647724497716
161
+ hash: 2902432510615899308
161
162
  required_rubygems_version: !ruby/object:Gem::Requirement
162
163
  none: false
163
164
  requirements:
@@ -166,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  version: '0'
167
168
  segments:
168
169
  - 0
169
- hash: -2659013647724497716
170
+ hash: 2902432510615899308
170
171
  requirements: []
171
172
  rubyforge_project:
172
173
  rubygems_version: 1.8.24