Links From Published Webs
Damn, but it's hard to get this right. I think I've finally done it, though. We'll see ...
This commit is contained in:
parent
97a35e280b
commit
761f8bbb51
3 changed files with 61 additions and 16 deletions
|
@ -329,6 +329,52 @@ class WikiControllerTest < ActionController::TestCase
|
|||
assert_response(:success)
|
||||
assert_equal @home, r.template_objects['page']
|
||||
assert_match /<a class='existingWikiWord' href='\/wiki1\/show\/ThatWay'>That Way<\/a>/, r.body
|
||||
|
||||
r = process 'save', 'web' => 'instiki', 'id' => 'HomePage', 'content' => 'Contents of a new page',
|
||||
'author' => 'AuthorOfNewPage'
|
||||
assert_equal Web.find_by_address('instiki').has_page?('HomePage'), true
|
||||
|
||||
r = process('published', 'web' => 'wiki1', 'id' => 'liquor')
|
||||
|
||||
assert_response(:success)
|
||||
assert_equal @liquor, r.template_objects['page']
|
||||
assert_match /<a class='existingWikiWord' href='\/instiki\/show\/HomePage'>go there<\/a>/, r.body
|
||||
|
||||
r = process('show', 'web' => 'wiki1', 'id' => 'liquor')
|
||||
|
||||
assert_response(:success)
|
||||
assert_equal @liquor, r.template_objects['page']
|
||||
assert_match /<a class='existingWikiWord' href='\/instiki\/show\/HomePage'>go there<\/a>/, r.body
|
||||
|
||||
Web.find_by_address('instiki').update_attribute(:published, true)
|
||||
|
||||
r = process('published', 'web' => 'wiki1', 'id' => 'liquor')
|
||||
|
||||
assert_response(:success)
|
||||
assert_equal @liquor, r.template_objects['page']
|
||||
assert_match /<a class='existingWikiWord' href='\/instiki\/published\/HomePage'>go there<\/a>/, r.body
|
||||
|
||||
r = process('show', 'web' => 'wiki1', 'id' => 'liquor')
|
||||
|
||||
assert_response(:success)
|
||||
assert_equal @liquor, r.template_objects['page']
|
||||
assert_match /<a class='existingWikiWord' href='\/instiki\/published\/HomePage'>go there<\/a>/, r.body
|
||||
|
||||
set_web_property :published, false
|
||||
|
||||
r = process('show', 'web' => 'wiki1', 'id' => 'liquor')
|
||||
|
||||
assert_response(:success)
|
||||
assert_equal @liquor, r.template_objects['page']
|
||||
assert_match /<a class='existingWikiWord' href='\/instiki\/published\/HomePage'>go there<\/a>/, r.body
|
||||
|
||||
Web.find_by_address('instiki').update_attribute(:published, false)
|
||||
|
||||
r = process('show', 'web' => 'wiki1', 'id' => 'liquor')
|
||||
|
||||
assert_response(:success)
|
||||
assert_equal @liquor, r.template_objects['page']
|
||||
assert_match /<a class='existingWikiWord' href='\/instiki\/show\/HomePage'>go there<\/a>/, r.body
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue