Odds and ends (#1866)

* Fix brittle spec

* remove unused module

* Fix another flaky test
This commit is contained in:
Andrew Cantino 2017-01-08 13:55:05 -05:00 committed by GitHub
parent 98f4310940
commit af5c5b5f62
3 changed files with 5 additions and 3 deletions

View file

@ -1,6 +1,5 @@
module Agents
class LiquidOutputAgent < Agent
include WebRequestConcern
include FormConfigurable
cannot_be_scheduled!

View file

@ -101,9 +101,9 @@ describe JobsController do
end
it "run the queued job" do
expect(Delayed::Job.last.run_at.to_s).not_to eq(Time.zone.now.to_s)
expect(Delayed::Job.last.run_at.to_i).not_to be_within(2).of(Time.zone.now.to_i)
post :retry_queued
expect(Delayed::Job.last.run_at.to_s).to eq(Time.zone.now.to_s)
expect(Delayed::Job.last.run_at.to_i).to be_within(2).of(Time.zone.now.to_i)
end
end
end

View file

@ -63,6 +63,7 @@ describe "Creating a new agent", js: true do
it "does not send previously configured sources when the current agent does not support them" do
select2("Website Agent scrapes", from: "Type")
sleep 0.5
select2("SF Weather", from: 'Sources')
select2("Webhook Agent", from: "Type")
fill_in(:agent_name, with: "No sources")
@ -74,6 +75,7 @@ describe "Creating a new agent", js: true do
it "does not send previously configured control targets when the current agent does not support them" do
select2("Commander Agent", from: "Type")
sleep 0.5
select2("SF Weather", from: 'Control targets')
select2("Webhook Agent", from: "Type")
fill_in(:agent_name, with: "No control targets")
@ -85,6 +87,7 @@ describe "Creating a new agent", js: true do
it "does not send previously configured receivers when the current agent does not support them" do
select2("Website Agent scrapes", from: "Type")
sleep 0.5
select2("ZKCD", from: 'Receivers')
select2("Email Agent", from: "Type")
fill_in(:agent_name, with: "No receivers")