Skip to content

Commit

Permalink
Odds and ends (#1866)
Browse files Browse the repository at this point in the history
* Fix brittle spec

* remove unused module

* Fix another flaky test
  • Loading branch information
cantino committed Jan 8, 2017
1 parent 98f4310 commit af5c5b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/models/agents/liquid_output_agent.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Agents
class LiquidOutputAgent < Agent
include WebRequestConcern
include FormConfigurable

cannot_be_scheduled!
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/jobs_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@
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
3 changes: 3 additions & 0 deletions spec/features/create_an_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

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")
Expand All @@ -74,6 +75,7 @@

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")
Expand All @@ -85,6 +87,7 @@

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")
Expand Down

0 comments on commit af5c5b5

Please sign in to comment.