|
23 | 23 | describe "#prepare_sections" do |
24 | 24 | context "with a content section" do |
25 | 25 | let(:sections) do |
26 | | - [{slug: "about", name: "About", type: :content, content: "<h1>About</h1>"}] |
| 26 | + [{ slug: "about", name: "About", type: :content, content: "<h1>About</h1>" }] |
27 | 27 | end |
28 | 28 |
|
29 | 29 | it "adds to pages and navbar", :aggregate_failures do |
|
42 | 42 | end |
43 | 43 |
|
44 | 44 | let(:sections) do |
45 | | - [{slug: "dashboard", name: "Dashboard", type: :page, page: page_class}] |
| 45 | + [{ slug: "dashboard", name: "Dashboard", type: :page, page: page_class }] |
46 | 46 | end |
47 | 47 |
|
48 | 48 | it "adds to pages and navbar", :aggregate_failures do |
|
56 | 56 |
|
57 | 57 | context "with a resource section" do |
58 | 58 | let(:sections) do |
59 | | - [{slug: "authors", name: "Authors", type: :resource, model: Author}] |
| 59 | + [{ slug: "authors", name: "Authors", type: :resource, model: Author }] |
60 | 60 | end |
61 | 61 |
|
62 | 62 | it "adds to resources and navbar", :aggregate_failures do |
|
71 | 71 |
|
72 | 72 | context "with a hidden resource section" do |
73 | 73 | let(:sections) do |
74 | | - [{slug: "secret", name: "Secret", type: :resource, model: Author, options: [:hidden]}] |
| 74 | + [{ slug: "secret", name: "Secret", type: :resource, model: Author, options: [:hidden] }] |
75 | 75 | end |
76 | 76 |
|
77 | 77 | it "adds to resources but not to visible navbar items", :aggregate_failures do |
|
84 | 84 |
|
85 | 85 | context "with a url section" do |
86 | 86 | let(:sections) do |
87 | | - [{slug: "google", name: "Google", type: :url, url: "https://google.com", options: {target: "_blank"}}] |
| 87 | + [{ slug: "google", name: "Google", type: :url, url: "https://google.com", options: { target: "_blank" } }] |
88 | 88 | end |
89 | 89 |
|
90 | 90 | it "adds to navbar with the url as path", :aggregate_failures do |
91 | 91 | store.prepare_sections(sections, logout: nil) |
92 | 92 | expect(store.navbar.size).to eq(1) |
93 | 93 | expect(store.navbar.first.path).to eq("https://google.com") |
94 | | - expect(store.navbar.first.options).to eq({target: "_blank"}) |
| 94 | + expect(store.navbar.first.options).to eq({ target: "_blank" }) |
95 | 95 | end |
96 | 96 |
|
97 | 97 | it "does not add to pages or resources", :aggregate_failures do |
|
105 | 105 | let(:section_module) do |
106 | 106 | mod = Class.new do |
107 | 107 | def self.to_h |
108 | | - {slug: "dynamic", name: "Dynamic", type: :content, content: "<p>Hi</p>"} |
| 108 | + { slug: "dynamic", name: "Dynamic", type: :content, content: "<p>Hi</p>" } |
109 | 109 | end |
110 | 110 | end |
111 | 111 | mod |
@@ -143,9 +143,9 @@ def self.to_h |
143 | 143 | context "with multiple section types" do |
144 | 144 | let(:sections) do |
145 | 145 | [ |
146 | | - {slug: "about", name: "About", type: :content, content: "<p>Test</p>"}, |
147 | | - {slug: "users", name: "Users", type: :resource, model: Author}, |
148 | | - {slug: "ext", name: "External", type: :url, url: "https://example.com"} |
| 146 | + { slug: "about", name: "About", type: :content, content: "<p>Test</p>" }, |
| 147 | + { slug: "users", name: "Users", type: :resource, model: Author }, |
| 148 | + { slug: "ext", name: "External", type: :url, url: "https://example.com" } |
149 | 149 | ] |
150 | 150 | end |
151 | 151 |
|
|
0 commit comments