nice_partials 0.1.6 → 0.9.0

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.
@@ -1,57 +0,0 @@
1
- require_relative "./test_helper"
2
-
3
- class RendererTest < ActiveSupport::TestCase
4
- # from actionview/render_test
5
- class TestController < ActionController::Base
6
- end
7
-
8
- def setup_view(paths)
9
- ActionView::Base.include(NicePartials::Helper)
10
-
11
- @assigns = { secret: "in the sauce" }
12
-
13
- @view = Class.new(ActionView::Base.with_empty_template_cache) do
14
- def view_cache_dependencies; []; end
15
-
16
- def combined_fragment_cache_key(key)
17
- [:views, key]
18
- end
19
- end.with_view_paths(paths, @assigns)
20
-
21
- controller = TestController.new
22
- controller.perform_caching = true
23
- controller.cache_store = :memory_store
24
- @view.controller = controller
25
-
26
- @controller_view = controller.view_context_class.with_empty_template_cache.new(
27
- controller.lookup_context,
28
- controller.view_assigns,
29
- controller)
30
- end
31
-
32
- def setup
33
- ActionView::LookupContext::DetailsKey.clear
34
- path = ActionView::FileSystemResolver.new(FIXTURE_LOAD_PATH)
35
- view_paths = ActionView::PathSet.new([path])
36
- assert_equal ActionView::FileSystemResolver.new(FIXTURE_LOAD_PATH), view_paths.first
37
- setup_view(view_paths)
38
- end
39
-
40
- def teardown
41
- ActionController::Base.view_paths.map(&:clear_cache)
42
- end
43
-
44
- test "render basic nice partial" do
45
- rendered = @view.render("basic") { |p| p.content_for :message, "hello from nice partials" }.squish
46
-
47
- assert_equal "hello from nice partials", rendered
48
- end
49
-
50
- test "render nice partial in card template" do
51
- rendered = @view.render(template: "card_test").squish
52
-
53
- assert_match "Some Title", rendered
54
- assert_match "Lorem Ipsum", rendered
55
- assert_match "https://example.com/image.jpg", rendered
56
- end
57
- end
data/test/test_helper.rb DELETED
@@ -1,7 +0,0 @@
1
- require "active_support"
2
- require "active_support/testing/autorun"
3
- require "action_controller"
4
- require "action_view"
5
- require "nice_partials"
6
-
7
- FIXTURE_LOAD_PATH = File.expand_path("fixtures", __dir__)