Use embedded groups example for tests

This commit is contained in:
Maikel Linke
2018-07-12 15:54:29 +10:00
parent 185cf9a312
commit ed747ec612
2 changed files with 3 additions and 13 deletions

View File

@@ -2,8 +2,6 @@ require 'spec_helper'
feature "Using embedded shopfront functionality", js: true do
Capybara.server_port = 9999
describe 'embedded groups' do
let(:enterprise) { create(:distributor_enterprise) }
let!(:group) { create(:enterprise_group, enterprises: [enterprise], permalink: 'group1', on_front_page: true) }
@@ -13,7 +11,7 @@ feature "Using embedded shopfront functionality", js: true do
Spree::Config[:embedded_shopfronts_whitelist] = 'test.com'
page.driver.browser.js_errors = false
allow_any_instance_of(ActionDispatch::Request).to receive(:referer).and_return('https://www.test.com')
Capybara.current_session.driver.visit('spec/support/views/group_iframe_test.html')
visit "/embedded-group-preview.html?group1"
end
it "displays in an iframe" do
@@ -69,9 +67,9 @@ feature "Using embedded shopfront functionality", js: true do
private
def on_embedded_page
expect(page).to have_selector 'iframe#group_test_iframe'
expect(page).to have_selector "iframe"
within_frame 'group_test_iframe' do
within_frame :frame do
yield
end
end

View File

@@ -1,8 +0,0 @@
<html>
<head></head>
<body>
<iframe src="http://localhost:9999/groups/group1?embedded_shopfront=true" class="group_test_iframe" id="group_test_iframe" style="width:100%;min-height:35em"></iframe>
</body>
</html>