Skip to content

Commit

Permalink
Add a spec for the url_on_receive option
Browse files Browse the repository at this point in the history
  • Loading branch information
knu committed Jun 19, 2015
1 parent 2764208 commit 1e336f0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/models/agents/website_agent_spec.rb
Expand Up @@ -633,6 +633,17 @@
}.to change { Event.count }.by(1)
end

it "should use url_on_receive as url to scrape if it exists when receiving an event" do
stub = stub_request(:any, 'http://example.org/?url=http%3A%2F%2Fxkcd.com')

@checker.options = @valid_options.merge(
'url_on_receive' => 'http://example.org/?url={{url | uri_escape}}'
)
@checker.receive([@event])

expect(stub).to have_been_requested
end

it "should interpolate values from incoming event payload" do
expect {
@valid_options['extract'] = {
Expand Down

0 comments on commit 1e336f0

Please sign in to comment.