|
20 | 20 | expect(page).to have_content('Home Content') |
21 | 21 | end |
22 | 22 |
|
23 | | - context 'when using a custom domain' do |
24 | | - scenario 'Public views the landing page from custom domain' do |
25 | | - website.update(domains: 'www.example.com') |
| 23 | + scenario 'Public views the landing page from custom domain', js: true do |
| 24 | + with_domain('lvh.me') do |
| 25 | + website.update(domains: 'www.lvh.me') |
26 | 26 | create(:page, published_body: 'Home Content', landing: true) |
27 | 27 | visit root_path |
28 | 28 |
|
29 | 29 | expect(page).to have_content('Home Content') |
30 | 30 | end |
| 31 | + end |
31 | 32 |
|
32 | | - scenario 'Public views the landing page for an older website on custom domain' do |
33 | | - website.update(domains: 'www.example.com') |
| 33 | + scenario 'Public views the landing page for an older website on custom domain', js: true do |
| 34 | + with_domain('lvh.me') do |
| 35 | + website.update(domains: 'www.lvh.me') |
34 | 36 | old_home_page = create(:page, published_body: 'Old Website', landing: true) |
35 | 37 | website.update(navigation_links: [old_home_page.slug]) |
36 | 38 |
|
37 | | - new_website = create(:website, domains: 'www.example.com') |
| 39 | + new_website = create(:website, domains: 'www.lvh.me') |
38 | 40 | new_home_page = create(:page, |
39 | | - website: new_website, |
40 | | - published_body: 'New Website', |
41 | | - landing: true) |
| 41 | + website: new_website, |
| 42 | + published_body: 'New Website', |
| 43 | + landing: true) |
42 | 44 |
|
43 | 45 | new_website.update(navigation_links: [new_home_page.slug]) |
44 | 46 | visit root_path |
|
53 | 55 | click_on(old_home_page.name, match: :first) |
54 | 56 | expect(page).to have_content('Old Website') |
55 | 57 | end |
| 58 | + end |
56 | 59 |
|
57 | | - scenario 'Public gets not found message for wrong path on subdomain' do |
58 | | - website.update(domains: 'www.example.com') |
| 60 | + scenario 'Public gets not found message for wrong path on subdomain' do |
| 61 | + website.update(domains: 'www.example.com') |
59 | 62 |
|
60 | | - visit landing_path(slug: website.event.slug) |
61 | | - expect(page).to have_content("Page Not Found") |
62 | | - end |
| 63 | + visit landing_path(slug: website.event.slug) |
| 64 | + expect(page).to have_content("Page Not Found") |
63 | 65 | end |
64 | 66 | end |
0 commit comments