Skip to content

Commit

Permalink
Fix spec failures
Browse files Browse the repository at this point in the history
  • Loading branch information
cantino committed Dec 20, 2016
1 parent 4e2d177 commit 65cea03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions app/models/agents/phantom_js_cloud_agent.rb
Expand Up @@ -12,13 +12,14 @@ class PhantomJsCloudAgent < Agent
default_schedule 'every_12h'

description <<-MD
[PhantomJs Cloud](https://phantomjscloud.com/) renders webpages in much the same way as a browser would, and allows the Website Agent to properly scrape dynamic content from javascript-heavy pages.
This Agent generates [PhantomJs Cloud](https://phantomjscloud.com/) URLs that can be used to render JavaScript-heavy webpages for content extraction.
The Phantom Js Cloud Agent is used to formulate a url in accordance with the [PhantomJs Cloud API](https://phantomjscloud.com/docs/index.html).
This url can then be supplied to Website Agent to fetch and parse content.
URLs generated by this Agent are formulated in accordance with the [PhantomJs Cloud API](https://phantomjscloud.com/docs/index.html).
The generated URLs can then be supplied to a Website Agent to fetch and parse the content.
[Sign up](https://dashboard.phantomjscloud.com/dash.html#/signup) to get an api key, and add it in Huginn credentials.
Please see the [Huginn Wiki for more info](https://github.com/cantino/huginn/wiki/Browser-Emulation-Using-PhantomJS-Cloud).
Options:
Expand All @@ -33,9 +34,7 @@ class PhantomJsCloudAgent < Agent
This is useful in case there are any AJAX requests or animations that need to finish up.
This can safely be set to 0 if you know there are no AJAX or animations you need to wait for (default: `1000`ms)
As this agent only provides a limited subset of the most commonly used options, you can follow [this guide](https://github.com/cantino/huginn/wiki/Browser-Emulation-Using-PhantomJS-Cloud) to make full use of additional options PhantomJsCloud provides.
MD

event_description <<-MD
Expand Down
9 changes: 4 additions & 5 deletions spec/features/create_an_agent_spec.rb
Expand Up @@ -38,7 +38,7 @@
visit new_agent_path
end
it "shows all options for agents that can be scheduled, create and receive events" do
select2("Website Agent", from: "Type")
select2("Website Agent scrapes", from: "Type")
expect(page).not_to have_content('This type of Agent cannot create events.')
end

Expand All @@ -49,9 +49,8 @@
end

it "allows to click on on the agent name in select2 tags" do
agent = agents(:bob_weather_agent)
visit new_agent_path
select2("Website Agent", from: "Type")
select2("Website Agent scrapes", from: "Type")
select2("SF Weather", from: 'Sources')
click_on "SF Weather"
expect(page).to have_content "Editing your WeatherAgent"
Expand All @@ -63,7 +62,7 @@
end

it "does not send previously configured sources when the current agent does not support them" do
select2("Website Agent", from: "Type")
select2("Website Agent scrapes", from: "Type")
select2("SF Weather", from: 'Sources')
select2("Webhook Agent", from: "Type")
fill_in(:agent_name, with: "No sources")
Expand All @@ -85,7 +84,7 @@
end

it "does not send previously configured receivers when the current agent does not support them" do
select2("Website Agent", from: "Type")
select2("Website Agent scrapes", from: "Type")
select2("ZKCD", from: 'Receivers')
select2("Email Agent", from: "Type")
fill_in(:agent_name, with: "No receivers")
Expand Down

0 comments on commit 65cea03

Please sign in to comment.