-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy path_site_header.html.haml_spec.rb
More file actions
39 lines (31 loc) · 1.08 KB
/
_site_header.html.haml_spec.rb
File metadata and controls
39 lines (31 loc) · 1.08 KB
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
require 'spec_helper'
module ApplicationHelper
def current_user
User.new
end
end
describe 'sites/shared/_site_header' do
context 'inactive affiliate banner' do
context 'when site is active' do
before { assign(:site, double('Site', active?: true, new_record?: true)) }
it 'does not render the inactive banner' do
render
expect(rendered).not_to have_selector('.site-header-inactive[aria-label="Inactive affiliate notification"]')
end
end
context 'when site is inactive' do
before { assign(:site, double('Site', active?: false, new_record?: true)) }
it 'renders the inactive banner' do
render
expect(rendered).to have_selector('.site-header-inactive[aria-label="Inactive affiliate notification"]')
end
end
context 'when site is nil (user-scoped pages)' do
before { assign(:site, nil) }
it 'does not render the inactive banner' do
render
expect(rendered).not_to have_selector('.site-header-inactive[aria-label="Inactive affiliate notification"]')
end
end
end
end