|
20 | 20 | expect(page).to have_content('Home Content')
|
21 | 21 | end
|
22 | 22 |
|
23 |
| - scenario 'Public views the landing page from custom domain' do |
24 |
| - website.update(domains: 'www.example.com') |
25 |
| - create(:page, published_body: 'Home Content', landing: true) |
26 |
| - visit root_path |
| 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 | + create(:page, published_body: 'Home Content', landing: true) |
| 27 | + visit root_path |
27 | 28 |
|
28 |
| - expect(page).to have_content('Home Content') |
| 29 | + expect(page).to have_content('Home Content') |
| 30 | + end |
29 | 31 | end
|
30 | 32 |
|
31 |
| - scenario 'Public views the landing page for an older website on custom domain' do |
32 |
| - website.update(domains: 'www.example.com') |
33 |
| - old_home_page = create(:page, published_body: 'Old Website', landing: true) |
34 |
| - website.update(navigation_links: [old_home_page.slug]) |
| 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') |
| 36 | + old_home_page = create(:page, published_body: 'Old Website', landing: true) |
| 37 | + website.update(navigation_links: [old_home_page.slug]) |
35 | 38 |
|
36 |
| - new_website = create(:website, domains: 'www.example.com') |
37 |
| - new_home_page = create(:page, |
38 |
| - website: new_website, |
39 |
| - published_body: 'New Website', |
40 |
| - landing: true) |
| 39 | + new_website = create(:website, domains: 'www.lvh.me') |
| 40 | + new_home_page = create(:page, |
| 41 | + website: new_website, |
| 42 | + published_body: 'New Website', |
| 43 | + landing: true) |
41 | 44 |
|
42 |
| - new_website.update(navigation_links: [new_home_page.slug]) |
43 |
| - visit root_path |
44 |
| - expect(page).to have_content('New Website') |
| 45 | + new_website.update(navigation_links: [new_home_page.slug]) |
| 46 | + visit root_path |
| 47 | + expect(page).to have_content('New Website') |
45 | 48 |
|
46 |
| - click_on(new_home_page.name, match: :first) |
47 |
| - expect(page).to have_content('New Website') |
| 49 | + click_on(new_home_page.name, match: :first) |
| 50 | + expect(page).to have_content('New Website') |
48 | 51 |
|
49 |
| - visit landing_path(slug: website.event.slug) |
50 |
| - expect(page).to have_content('Old Website') |
| 52 | + visit landing_path(slug: website.event.slug) |
| 53 | + expect(page).to have_content('Old Website') |
51 | 54 |
|
52 |
| - click_on(old_home_page.name, match: :first) |
53 |
| - expect(page).to have_content('Old Website') |
| 55 | + click_on(old_home_page.name, match: :first) |
| 56 | + expect(page).to have_content('Old Website') |
| 57 | + end |
54 | 58 | end
|
55 | 59 |
|
56 | 60 | scenario 'Public gets not found message for wrong path on subdomain' do
|
|
0 commit comments