docbrown/spec/tasks/fastly_spec.rb
Alex 8b51d8e4b8
[deploy] Fix Fastly rake task spec and Travis CI (#7487)
* Try changing exit to next

* Add breaking test

* Fix search.rake

* Remove test failure
2020-04-23 16:06:57 -04:00

19 lines
747 B
Ruby

require "rails_helper"
RSpec.describe "Fastly tasks", type: :task do
before do
Rake::Task.clear
PracticalDeveloper::Application.load_tasks
end
describe "#update_whitelisted_params" do
it "doesn't run if Fastly isn't configured" do
allow(ApplicationConfig).to receive(:[]).with("FASTLY_API_KEY").and_return(nil)
allow(ApplicationConfig).to receive(:[]).with("FASTLY_SERVICE_ID").and_return(nil)
allow(ApplicationConfig).to receive(:[]).with("FASTLY_WHITELIST_PARAMS_SNIPPET_NAME").and_return(nil)
allow(FastlyVCL::WhitelistedParams).to receive(:update)
Rake::Task["fastly:update_whitelisted_params"].invoke
expect(FastlyVCL::WhitelistedParams).not_to have_received(:update)
end
end
end