mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove bugherd specs
I don't think these are worth the time it takes to execute them every time but most importantly I believe we are not using Bugherd anymore.
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
feature 'External services' do
|
||||
include AuthenticationWorkflow
|
||||
include WebHelper
|
||||
|
||||
describe "bugherd" do
|
||||
describe "limiting inclusion by environment" do
|
||||
before { Spree::Config.bugherd_api_key = 'abc123' }
|
||||
|
||||
it "is not included in test" do
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).to be_nil
|
||||
end
|
||||
|
||||
it "is not included in dev" do
|
||||
allow(Rails.env).to receive(:development?) { true }
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).to be_nil
|
||||
end
|
||||
|
||||
it "is included in staging" do
|
||||
allow(Rails.env).to receive(:staging?) { true }
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).not_to be_nil
|
||||
end
|
||||
|
||||
it "is included in production" do
|
||||
allow(Rails.env).to receive(:production?) { true }
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).not_to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "in an environment where BugHerd is displayed" do
|
||||
before { allow(Rails.env).to receive(:staging?) { true } }
|
||||
|
||||
context "when there is no API key set" do
|
||||
before { Spree::Config.bugherd_api_key = nil }
|
||||
|
||||
it "does not include the BugHerd script" do
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "when an API key is set" do
|
||||
before { Spree::Config.bugherd_api_key = 'abc123' }
|
||||
|
||||
it "includes the BugHerd script, with the correct API key" do
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).to include 'abc123'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user