This commit is contained in:
Erwan
2012-09-04 13:56:22 +02:00
parent eb10741912
commit 773ed7a2d1
2 changed files with 11 additions and 3 deletions

View File

@@ -4,12 +4,12 @@ describe WpTarget do
before :each do
Browser.reset
browser_options =
@browser_options =
{
:config_file => SPEC_FIXTURES_CONF_DIR + '/browser/browser.conf.json',
:cache_timeout => 0
}
@wp_target = WpTarget.new("http://example.localhost/", browser_options)
@wp_target = WpTarget.new("http://example.localhost/", @browser_options)
end
it_should_behave_like "WebSite"
@@ -27,6 +27,14 @@ describe WpTarget do
expect { WpTarget.new(nil) }.to raise_error
expect { Wptarget.new('') }.to raise_error
end
it "should add the http protocol if missing" do
WpTarget.new("example.localhost/", @browser_options).url.should === "http://example.localhost/"
end
it "should add the trailing slash to the url if missing" do
WpTarget.new("lamp/wordpress", @browser_options).url.should === "http://lamp/wordpress/"
end
end
describe "#url" do