intercom-rails 0.2.22 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -58,7 +58,9 @@ module IntercomRails
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def enabled_for_environment?
|
|
61
|
-
IntercomRails.config.enabled_environments
|
|
61
|
+
enabled_environments = IntercomRails.config.enabled_environments
|
|
62
|
+
return true if enabled_environments.nil?
|
|
63
|
+
enabled_environments.include?(Rails.env)
|
|
62
64
|
end
|
|
63
65
|
|
|
64
66
|
end
|
|
@@ -59,12 +59,10 @@ class AutoIncludeFilterTest < ActionController::TestCase
|
|
|
59
59
|
def setup
|
|
60
60
|
super
|
|
61
61
|
IntercomRails.config.app_id = 'my_app_id'
|
|
62
|
-
IntercomRails.config.enabled_environments = ["production"]
|
|
63
62
|
end
|
|
64
63
|
|
|
65
64
|
def teardown
|
|
66
65
|
IntercomRails.config.app_id = nil
|
|
67
|
-
Rails.stub(:env) { ActiveSupport::StringInquirer.new("production") }
|
|
68
66
|
end
|
|
69
67
|
|
|
70
68
|
def test_no_user_present
|
|
@@ -166,16 +164,17 @@ class AutoIncludeFilterTest < ActionController::TestCase
|
|
|
166
164
|
assert_equal @response.body, "<body>Hello world</body>"
|
|
167
165
|
end
|
|
168
166
|
|
|
169
|
-
def
|
|
167
|
+
def test_disabled_in_development
|
|
170
168
|
Rails.stub(:env) { ActiveSupport::StringInquirer.new("development") }
|
|
171
169
|
IntercomRails.config.enabled_environments = ["production"]
|
|
172
170
|
get :with_user_instance_variable, :body => "<body>Hello world</body>"
|
|
173
171
|
|
|
174
172
|
assert_equal @response.body, "<body>Hello world</body>"
|
|
173
|
+
Rails.unstub(:env)
|
|
175
174
|
end
|
|
176
175
|
|
|
177
|
-
def
|
|
178
|
-
#
|
|
176
|
+
def test_enabled_in_production
|
|
177
|
+
# Rails.env defaults to "production"
|
|
179
178
|
IntercomRails.config.enabled_environments = ["production"]
|
|
180
179
|
get :with_user_instance_variable, :body => "<body>Hello world</body>"
|
|
181
180
|
|
|
@@ -183,6 +182,6 @@ class AutoIncludeFilterTest < ActionController::TestCase
|
|
|
183
182
|
assert_includes @response.body, IntercomRails.config.app_id
|
|
184
183
|
assert_includes @response.body, "ben@intercom.io"
|
|
185
184
|
assert_includes @response.body, "Ben McRedmond"
|
|
186
|
-
|
|
187
185
|
end
|
|
186
|
+
|
|
188
187
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: intercom-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.23
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2013-06-
|
|
14
|
+
date: 2013-06-20 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: activesupport
|
|
@@ -50,17 +50,17 @@ dependencies:
|
|
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
|
51
51
|
none: false
|
|
52
52
|
requirements:
|
|
53
|
-
- - ! '
|
|
53
|
+
- - ! '>'
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version:
|
|
55
|
+
version: 3.2.12
|
|
56
56
|
type: :development
|
|
57
57
|
prerelease: false
|
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
|
59
59
|
none: false
|
|
60
60
|
requirements:
|
|
61
|
-
- - ! '
|
|
61
|
+
- - ! '>'
|
|
62
62
|
- !ruby/object:Gem::Version
|
|
63
|
-
version:
|
|
63
|
+
version: 3.2.12
|
|
64
64
|
- !ruby/object:Gem::Dependency
|
|
65
65
|
name: rspec-mocks
|
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -100,7 +100,7 @@ dependencies:
|
|
|
100
100
|
requirements:
|
|
101
101
|
- - ~>
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: 1.3
|
|
103
|
+
version: 1.4.3
|
|
104
104
|
type: :development
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -108,7 +108,7 @@ dependencies:
|
|
|
108
108
|
requirements:
|
|
109
109
|
- - ~>
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
|
-
version: 1.3
|
|
111
|
+
version: 1.4.3
|
|
112
112
|
- !ruby/object:Gem::Dependency
|
|
113
113
|
name: thin
|
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -195,18 +195,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
195
195
|
- - ! '>='
|
|
196
196
|
- !ruby/object:Gem::Version
|
|
197
197
|
version: '0'
|
|
198
|
-
segments:
|
|
199
|
-
- 0
|
|
200
|
-
hash: 4050575702279904448
|
|
201
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
199
|
none: false
|
|
203
200
|
requirements:
|
|
204
201
|
- - ! '>='
|
|
205
202
|
- !ruby/object:Gem::Version
|
|
206
203
|
version: '0'
|
|
207
|
-
segments:
|
|
208
|
-
- 0
|
|
209
|
-
hash: 4050575702279904448
|
|
210
204
|
requirements: []
|
|
211
205
|
rubyforge_project: intercom-rails
|
|
212
206
|
rubygems_version: 1.8.23
|
|
@@ -225,3 +219,4 @@ test_files:
|
|
|
225
219
|
- test/intercom-rails/script_tag_helper_test.rb
|
|
226
220
|
- test/intercom-rails/script_tag_test.rb
|
|
227
221
|
- test/test_setup.rb
|
|
222
|
+
has_rdoc:
|