Skip to content

Commit

Permalink
Using official method url=() instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Tolf Tolfsen committed Nov 19, 2010
1 parent 7e760ad commit 7e081da
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
41 changes: 36 additions & 5 deletions browser_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
# encoding: utf-8
require File.expand_path(''../../watirspec_helper'', __FILE__)
require File.expand_path('../../watirspec_helper', __FILE__)

describe 'Browser' do

#goto(), back(), forward(), version, url, get/set prefs()
before :all do
browser.url = fixture('simple.html')
end

#url(), back(), forward(), version, url, get/set prefs()

describe '#new' do
it 'constructs a new instance' do
new_browser = OperaWatir::Browser.new
new_browser.exists?.should be_true
end
end

describe '#name' do
it 'is the name of a Watir implementation' do
implementations = %w{ ie firefox opera }
browser.name.should == implementations
end
end

describe '#url=' do # goto() is an alias
it 'opens a new window' do
browser.goto fixture('simple.html')

end

describe '#goto' do
it 'navigates to a url' do
window.url = 'http://example.com/'
window.url.should == 'http://example.com/'
window.url = fixture('simple.html')
# window.url.should == ''
end

it 'navigates to a url using goto alias' do
window.goto fixture('simple.html')
end

after :each do
window.url.should = fixture('simple.html')
end
end

Expand Down
2 changes: 1 addition & 1 deletion window_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe 'Window' do

before :each do
browser.goto(fixture('non_control_elements.html'))
browser.url = fixture('non_control_elements.html')
end

# element access
Expand Down

0 comments on commit 7e081da

Please sign in to comment.