remote_partial 0.2.0 → 0.2.1
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.
- data/lib/remote_partial/version.rb +15 -1
- data/lib/remote_partial.rb +10 -7
- data/test/dummy/app/views/remote_partials/_clock.html.erb +1 -1
- data/test/dummy/config/environments/development.rb +1 -1
- data/test/dummy/config/environments/test.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +778 -0
- data/test/dummy/log/test.log +2814 -0
- data/test/dummy/test/unit/helpers/demos_helper_test.rb +9 -2
- data/test/test_helper.rb +2 -7
- data/test/unit/remote_partial/builder_test.rb +0 -4
- data/test/unit/remote_partial/partial_test.rb +0 -4
- data/test/unit/remote_partial/resource_manager_test.rb +0 -4
- metadata +2 -20
- data/test/dummy/app/views/remote_partials/_wcc.html.erb +0 -749
@@ -5,9 +5,16 @@ class DemosHelperTest < ActionView::TestCase
|
|
5
5
|
include RemotePartial::HostAppHelper
|
6
6
|
|
7
7
|
def test_render_remote_partial_with_no_partial
|
8
|
-
|
9
|
-
|
8
|
+
if Rails.version.to_i == 4
|
9
|
+
assert_raise ArgumentError do
|
10
|
+
render_remote_partial 'non-existent-partial'
|
11
|
+
end
|
12
|
+
else
|
13
|
+
assert_raise ActionView::MissingTemplate do
|
14
|
+
render_remote_partial 'non-existent-partial'
|
15
|
+
end
|
10
16
|
end
|
17
|
+
|
11
18
|
end
|
12
19
|
|
13
20
|
end
|
data/test/test_helper.rb
CHANGED
@@ -3,6 +3,8 @@ ENV["RAILS_ENV"] = "test"
|
|
3
3
|
|
4
4
|
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
5
|
require "rails/test_help"
|
6
|
+
require 'webmock'
|
7
|
+
require 'webmock/minitest'
|
6
8
|
require 'webmock/test_unit'
|
7
9
|
|
8
10
|
Rails.backtrace_cleaner.remove_silencers!
|
@@ -19,28 +21,21 @@ class ActiveSupport::TestCase
|
|
19
21
|
fixtures :all
|
20
22
|
|
21
23
|
def enable_mock(url, body = '<body><h1>Something</h1><p>Else</p></body>')
|
22
|
-
WebMock.enable!
|
23
24
|
stub_request(:get, url).
|
24
25
|
with(:headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
|
25
26
|
to_return(:status => 200, :body => body, :headers => {})
|
26
27
|
end
|
27
28
|
|
28
29
|
def enable_mock_connection_failure(url, status = 400)
|
29
|
-
WebMock.enable!
|
30
30
|
stub_request(:get, url).
|
31
31
|
with(:headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
|
32
32
|
to_return(:status => status, :body => 'Whoops!', :headers => {})
|
33
33
|
end
|
34
34
|
|
35
35
|
def enable_mock_connection_error(url)
|
36
|
-
WebMock.enable!
|
37
36
|
stub_request(:get, url).to_raise(SocketError.new("Some connection error"))
|
38
37
|
end
|
39
38
|
|
40
|
-
def disable_mock
|
41
|
-
WebMock.disable!
|
42
|
-
end
|
43
|
-
|
44
39
|
def assert_equal_ignoring_cr(expected, testing, comment = nil)
|
45
40
|
cr = "\n"
|
46
41
|
assert_equal(expected, testing.gsub(cr, ""), comment)
|
@@ -10,10 +10,6 @@ module RemotePartial
|
|
10
10
|
enable_mock(@partial.url, @body)
|
11
11
|
end
|
12
12
|
|
13
|
-
def teardown
|
14
|
-
disable_mock
|
15
|
-
end
|
16
|
-
|
17
13
|
def test_output_file_name
|
18
14
|
expected = "#{RemotePartial.partial_location}/_#{@partial.name}.html.erb"
|
19
15
|
assert_equal expected, @partial.output_file_name
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote_partial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
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: 2013-07-
|
12
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -59,22 +59,6 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: webmock
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
78
62
|
description: ! "RemotePartial comprises:\n a system to grab content from a remote
|
79
63
|
page and copy that content into partials;\n a process to allow content to be regularly
|
80
64
|
updated;\n a helper method to ease inclusion of the partial with a view\"\n"
|
@@ -110,7 +94,6 @@ files:
|
|
110
94
|
- test/dummy/app/views/demos/_ruby.html.erb
|
111
95
|
- test/dummy/app/views/layouts/application.html.erb
|
112
96
|
- test/dummy/app/views/remote_partials/_clock.html.erb
|
113
|
-
- test/dummy/app/views/remote_partials/_wcc.html.erb
|
114
97
|
- test/dummy/app/views/remote_partials/_fixed.html.erb
|
115
98
|
- test/dummy/app/views/remote_partials/_ruby.html.erb
|
116
99
|
- test/dummy/app/controllers/application_controller.rb
|
@@ -217,7 +200,6 @@ test_files:
|
|
217
200
|
- test/dummy/app/views/demos/_ruby.html.erb
|
218
201
|
- test/dummy/app/views/layouts/application.html.erb
|
219
202
|
- test/dummy/app/views/remote_partials/_clock.html.erb
|
220
|
-
- test/dummy/app/views/remote_partials/_wcc.html.erb
|
221
203
|
- test/dummy/app/views/remote_partials/_fixed.html.erb
|
222
204
|
- test/dummy/app/views/remote_partials/_ruby.html.erb
|
223
205
|
- test/dummy/app/controllers/application_controller.rb
|