-
Notifications
You must be signed in to change notification settings - Fork 32
/
page_decorator_test.rb
39 lines (30 loc) · 1.14 KB
/
page_decorator_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true
require "test_helper"
module GobiertoCms
class PageDecoratorTest < ActiveSupport::TestCase
def site_page_decorated
@site_page_decorated ||= GobiertoCms::PageDecorator.new(site_page)
end
def themes_page_decorated
@themes_page_decorated ||= GobiertoCms::PageDecorator.new(themes_page)
end
def site_page
@site_page ||= gobierto_cms_pages(:consultation_faq)
end
def themes_page
@themes_page ||= gobierto_cms_pages(:themes)
end
def test_main_image
assert_equal "https://gobierto-public-resources.s3.amazonaws.com/gobierto-attachments/imagen.png", site_page_decorated.main_image
end
def test_template
assert_equal "gobierto_cms/pages/templates/page", site_page_decorated.template
assert_equal "gobierto_participation/processes/pages/templates/news", themes_page_decorated.template
site_page_decorated.template = "raw_page"
assert_equal "gobierto_cms/pages/templates/raw_page", site_page_decorated.template
end
def test_summary
assert_equal "This is the body of the page", site_page_decorated.summary
end
end
end