Changeset 1243
- Timestamp:
- 2008-10-31 10:50:13 (2 months ago)
- Files:
-
- trunk/app/helpers/application_helper.rb (modified) (1 diff)
- trunk/test/helpers/zazen_test.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/helpers/application_helper.rb
r1242 r1243 451 451 link_opts[:sharp_in] = sharp_in 452 452 end 453 link_opts[:sharp] = sharp 453 if ['[id]', '[zip]'].include?(sharp) 454 link_opts[:sharp] = 'true' 455 else 456 link_opts[:sharp] = sharp 457 end 454 458 end 455 459 if opts[:id] =~ /(\d+)(_\w+|)(\.\w+|)/ trunk/test/helpers/zazen_test.rb
r1242 r1243 29 29 30 30 end 31 31 32 32 def test_make_link 33 33 login(:tiger) … … 38 38 # * ["":034] if the node id starts with '0', creates a popup link. 39 39 assert_match %r{/oo/projects/cleanWater.*window.open.*hello}, zazen('"hello":021') 40 end 41 42 def test_make_link_sharp 43 login(:tiger) 44 assert_equal '<p><a href="#node34">hello</a></p>', zazen('"hello":34#') 45 assert_equal '<p><a href="#node34">hello</a></p>', zazen('"hello":34#[id]') 46 assert_equal '<p><a href="#node34">hello</a></p>', zazen('"hello":34#[zip]') 47 assert_equal '<p><a href="#news">hello</a></p>', zazen('"hello":34#[name]') 48 # * ["":34#[parent/]] if the node id starts with '0', creates a popup link. 49 assert_equal '<p><a href="/oo/page32.html#node34">hello</a></p>', zazen('"hello":34#[parent/]') 50 assert_equal '<p><a href="/oo/page32.html#node34">hello</a></p>', zazen('"hello":34#[parent/id]') 51 assert_equal '<p><a href="/oo/page32.html#node34">hello</a></p>', zazen('"hello":34#[parent/zip]') 52 assert_equal '<p><a href="/oo/page32.html#news">hello</a></p>', zazen('"hello":34#[parent/name]') 40 53 end 41 54 … … 158 171 @node = secure!(Node) { nodes(:wiki) } 159 172 assert_equal "<p>See <a href=\"/oo/projects/cleanWater\"><img src='/en/image30_med.jpg' width='220' height='200' alt='bird' class='med'/></a></p>", zazen('See !:(bird)_med!:(/projects/cleanWater)') 173 end 174 175 def test_bad_pseudo_path 176 login(:lion) 177 lion = secure!(Node) { nodes(:lion) } 178 179 @node = secure!(Node) { nodes(:cleanWater) } 180 assert_equal '<p>Read [(shmol) not found]</p>', zazen('Read "":(shmol)') 181 assert_equal 'Read "":(shmol)', zazen('Read "":(shmol)', :translate_ids => :zip, :node => lion) 160 182 end 161 183
