Some more assertions in the Watir test
This commit is contained in:
parent
acda6f3ed1
commit
f92c000b1c
1 changed files with 6 additions and 0 deletions
|
@ -79,6 +79,10 @@ class E2EInstikiTest < Test::Unit::TestCase
|
||||||
links_to_homepage = ie.links.to_a.select { |link| link.text == 'Home Page' }
|
links_to_homepage = ie.links.to_a.select { |link| link.text == 'Home Page' }
|
||||||
assert_equal 3, links_to_homepage.size
|
assert_equal 3, links_to_homepage.size
|
||||||
links_to_homepage.each { |link| assert_equal url(:show, 'HomePage'), link.href }
|
links_to_homepage.each { |link| assert_equal url(:show, 'HomePage'), link.href }
|
||||||
|
|
||||||
|
# Check also the "created on ... by ..." footnote
|
||||||
|
date_pattern = '(January|February|March|April|May|June|July|August|September|October|November|December) \d\d?, \d\d\d\d \d\d:\d\d'
|
||||||
|
assert_match Regexp.new('Created on ' + date_pattern + ' by Anonymous Coward\?'), ie.text
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -103,7 +107,9 @@ class E2EInstikiTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_footnote
|
def check_footnote
|
||||||
|
assert_match /This site is running on Instiki/, ie.text
|
||||||
assert_equal 'http://instiki.org/', ie.link(:text, 'Instiki').href
|
assert_equal 'http://instiki.org/', ie.link(:text, 'Instiki').href
|
||||||
|
assert_match /Powered by Ruby on Rails/, ie.text
|
||||||
assert_equal 'http://rubyonrails.com/', ie.link(:text, 'Ruby on Rails').href
|
assert_equal 'http://rubyonrails.com/', ie.link(:text, 'Ruby on Rails').href
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue