You are here: Home > Latest news from Darcs > Refactors test to avoid clutter

Revision 20080401222659-9043f-b6485a...

Refactors test to avoid clutter

test/fixtures/pages.yml
test/fixtures/revisions.yml
test/functional/wiki_controller_test.rb

Changes to pages.yml

80
  kind: feature
  kind: feature
80
81
  modified_at: 2020-02-22 15:57:37
  modified_at: 2020-02-22 15:57:37
81
82
82
 
page_with_syntax_error:
83
 
  id: 16
84
 
  name: ParsingError
85
 
  kind: common
86
 
  modified_at: 2008-04-01 19:23:42
87
 
88

Changes to revisions.yml

221
  text: This features requires the completion of [[ListLastModifiedFeatures]]
  text: This features requires the completion of [[ListLastModifiedFeatures]]
221
222
        and [[FinishedFeature]]
        and [[FinishedFeature]]
222
223
223
 
page_creation_without_syntax_error:
224
 
  id: 21
225
 
  page_id: 16
226
 
  kind: common
227
 
  modified_at: 2008-04-01 18:17:26
228
 
  last_editor_id: 1000005 #eric
229
 
  editors: ""
230
 
  title: Parsing Error
231
 
  position: 1
232
 
  text: There is no syntax error in the English version
233
 
        
234
 
        --- pt-br -----------
235
 
        
236
 
        Não há erro sintático na versão em português
237
 
238
 
page_revision_with_syntax_error:
239
 
  id: 22
240
 
  page_id: 16
241
 
  kind: common
242
 
  modified_at: 2008-04-01 19:23:42
243
 
  last_editor_id: 1000005 #eric
244
 
  editors: ""
245
 
  title: Parsing Error
246
 
  position: 2
247
 
  text: --- pt-br -----------
248
 
        
249
 
        Não há erro sintático na versão em português
250
 
251

Changes to wiki_controller_test.rb

524
  end
  end
524
525
525
526
  def test_shows_wiki_source_for_pages_with_parsing_errors
  def test_shows_wiki_source_for_pages_with_parsing_errors
526
527
    name = 'ParsingError'
    page = pages('page_with_syntax_error')
527
528
    log_as :bob
    get :show, :page_name => page.name
528
529
    post :save, :page_name => name, :btnSave => true, 
 
530
                :page => { :title => 'Parsing error',
 
531
                           :text => '',
 
532
                           :done => '0',
 
533
                           :kind => 'common', :editors => '' }
 
534
    follow_redirect
 
535
    assert_tag :div, :attributes => { :class => "message wikierror" }
    assert_tag :div, :attributes => { :class => "message wikierror" }
529
536
    assert_tag :pre, :content => ''
    assert_tag :pre, :content => page.text
530
537
  end
  end
531
538
532
539
private
private
533