Commit 981b0c92928691b9bc818ff3851f3344c1f3924b

Authored by Victor Costa
1 parent dd2b6081

rails3: fix cms_controller tests

app/controllers/my_profile/cms_controller.rb
@@ -45,8 +45,7 @@ class CmsController < MyProfileController @@ -45,8 +45,7 @@ class CmsController < MyProfileController
45 conditions = ['type != ?', 'RssFeed'] 45 conditions = ['type != ?', 'RssFeed']
46 end 46 end
47 47
48 - @articles = @article.children.paginate(  
49 - :order => "case when type = 'Folder' then 0 when type ='Blog' then 1 else 2 end, updated_at DESC", 48 + @articles = @article.children.reorder("case when type = 'Folder' then 0 when type ='Blog' then 1 else 2 end, updated_at DESC, name").paginate(
50 :conditions => conditions, 49 :conditions => conditions,
51 :per_page => per_page, 50 :per_page => per_page,
52 :page => params[:npage] 51 :page => params[:npage]
@@ -188,7 +187,7 @@ class CmsController < MyProfileController @@ -188,7 +187,7 @@ class CmsController < MyProfileController
188 if request.post? 187 if request.post?
189 @article.destroy 188 @article.destroy
190 session[:notice] = _("\"#{@article.name}\" was removed.") 189 session[:notice] = _("\"#{@article.name}\" was removed.")
191 - referer = ActionController::Routing::Routes.recognize_path URI.parse(request.referer).path rescue nil 190 + referer = Rails.application.routes.recognize_path URI.parse(request.referer).path rescue nil
192 if referer and referer[:controller] == 'cms' 191 if referer and referer[:controller] == 'cms'
193 redirect_to referer 192 redirect_to referer
194 elsif @article.parent 193 elsif @article.parent
app/controllers/public/content_viewer_controller.rb
@@ -88,7 +88,7 @@ class ContentViewerController < ApplicationController @@ -88,7 +88,7 @@ class ContentViewerController < ApplicationController
88 blog_with_translation = @page.blog? && @page.display_posts_in_current_language? 88 blog_with_translation = @page.blog? && @page.display_posts_in_current_language?
89 posts = posts.native_translations if blog_with_translation 89 posts = posts.native_translations if blog_with_translation
90 90
91 - @posts = posts.paginate({ :page => params[:npage], :per_page => @page.posts_per_page }.merge(Article.display_filter(user, profile))) 91 + @posts = posts.paginate({ :page => params[:npage], :per_page => @page.posts_per_page }.merge(Article.display_filter(user, profile))).to_a
92 92
93 if blog_with_translation 93 if blog_with_translation
94 @posts.replace @posts.map{ |p| p.get_translation_to(FastGettext.locale) }.compact 94 @posts.replace @posts.map{ |p| p.get_translation_to(FastGettext.locale) }.compact
config/application.rb
@@ -25,6 +25,8 @@ module Noosfero @@ -25,6 +25,8 @@ module Noosfero
25 # Adds custom tags to the Set of allowed html tags for the #sanitize helper 25 # Adds custom tags to the Set of allowed html tags for the #sanitize helper
26 config.action_view.sanitized_allowed_tags = 'object', 'embed', 'param', 'table', 'tr', 'th', 'td', 'applet', 'comment', 'iframe', 'audio', 'video', 'source' 26 config.action_view.sanitized_allowed_tags = 'object', 'embed', 'param', 'table', 'tr', 'th', 'td', 'applet', 'comment', 'iframe', 'audio', 'video', 'source'
27 27
  28 + config.action_controller.include_all_helpers = false
  29 +
28 # Settings in config/environments/* take precedence over those specified here. 30 # Settings in config/environments/* take precedence over those specified here.
29 # Application configuration should go into files in config/initializers 31 # Application configuration should go into files in config/initializers
30 # -- all .rb files in that directory are automatically loaded. 32 # -- all .rb files in that directory are automatically loaded.
test/functional/cms_controller_test.rb
@@ -12,10 +12,6 @@ class CmsControllerTest < ActionController::TestCase @@ -12,10 +12,6 @@ class CmsControllerTest < ActionController::TestCase
12 12
13 def setup 13 def setup
14 super 14 super
15 - @controller = CmsController.new  
16 - @request = ActionController::TestRequest.new  
17 - @response = ActionController::TestResponse.new  
18 -  
19 @profile = create_user_with_permission('testinguser', 'post_content') 15 @profile = create_user_with_permission('testinguser', 'post_content')
20 login_as :testinguser 16 login_as :testinguser
21 end 17 end
@@ -137,7 +133,7 @@ class CmsControllerTest < ActionController::TestCase @@ -137,7 +133,7 @@ class CmsControllerTest < ActionController::TestCase
137 a.save! 133 a.save!
138 134
139 profile.description = 'a' * 600 135 profile.description = 'a' * 600
140 - profile.save(false) 136 + profile.save(:validate => false)
141 137
142 assert !profile.valid? 138 assert !profile.valid?
143 assert_not_equal a, profile.home_page 139 assert_not_equal a, profile.home_page
@@ -403,7 +399,7 @@ class CmsControllerTest < ActionController::TestCase @@ -403,7 +399,7 @@ class CmsControllerTest < ActionController::TestCase
403 get :view, :profile => profile.identifier, :id => article.id 399 get :view, :profile => profile.identifier, :id => article.id
404 assert_response :success 400 assert_response :success
405 assert_template 'view' 401 assert_template 'view'
406 - assert_tag :tag => 'a', :attributes => { :title => 'New content', :href => "/myprofile/#{profile.identifier}/cms/new?cms=true&parent_id=#{article.id}"} 402 + assert_tag :tag => 'a', :attributes => { :title => 'New content', :href => "/myprofile/#{profile.identifier}/cms/new?cms=true&parent_id=#{article.id}"}
407 end 403 end
408 404
409 should 'offer to create children' do 405 should 'offer to create children' do
@@ -414,7 +410,7 @@ class CmsControllerTest < ActionController::TestCase @@ -414,7 +410,7 @@ class CmsControllerTest < ActionController::TestCase
414 article.save! 410 article.save!
415 411
416 get :new, :profile => profile.identifier, :parent_id => article.id, :cms => true 412 get :new, :profile => profile.identifier, :parent_id => article.id, :cms => true
417 - assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/new?parent_id=#{article.id}&type=TextileArticle"} 413 + assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/new?parent_id=#{article.id}&type=TextileArticle"}
418 end 414 end
419 415
420 should 'not offer to create children if article does not accept them' do 416 should 'not offer to create children if article does not accept them' do
@@ -559,7 +555,7 @@ class CmsControllerTest < ActionController::TestCase @@ -559,7 +555,7 @@ class CmsControllerTest < ActionController::TestCase
559 f = Folder.new(:name => 'f'); profile.articles << f; f.save! 555 f = Folder.new(:name => 'f'); profile.articles << f; f.save!
560 get :new, :profile => profile.identifier, :parent_id => f.id, :cms => true 556 get :new, :profile => profile.identifier, :parent_id => f.id, :cms => true
561 557
562 - assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/new?parent_id=#{f.id}&amp;type=Folder" } 558 + assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/new?parent_id=#{f.id}&type=Folder" }
563 end 559 end
564 560
565 should 'redirect to article after creating top-level article' do 561 should 'redirect to article after creating top-level article' do
@@ -1512,7 +1508,7 @@ class CmsControllerTest &lt; ActionController::TestCase @@ -1512,7 +1508,7 @@ class CmsControllerTest &lt; ActionController::TestCase
1512 should 'update file and be redirect to cms' do 1508 should 'update file and be redirect to cms' do
1513 file = UploadedFile.create!(:profile => @profile, :uploaded_data => fixture_file_upload('files/test.txt', 'text/plain')) 1509 file = UploadedFile.create!(:profile => @profile, :uploaded_data => fixture_file_upload('files/test.txt', 'text/plain'))
1514 post :edit, :profile => @profile.identifier, :id => file.id, :article => { } 1510 post :edit, :profile => @profile.identifier, :id => file.id, :article => { }
1515 - assert_redirected_to :controller => 'cms', :profile => profile.identifier, :action => 'index' 1511 + assert_redirected_to :controller => 'cms', :profile => profile.identifier, :action => 'index', :id => nil
1516 end 1512 end
1517 1513
1518 should 'update file and be redirect to cms folder' do 1514 should 'update file and be redirect to cms folder' do
test/functional/content_viewer_controller_test.rb
@@ -330,20 +330,20 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -330,20 +330,20 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
330 should 'redirect to new article path under an old path' do 330 should 'redirect to new article path under an old path' do
331 p = create_user('test_user').person 331 p = create_user('test_user').person
332 a = p.articles.create(:name => 'old-name') 332 a = p.articles.create(:name => 'old-name')
333 - old_path = a.explode_path 333 + old_path = a.path
334 a.name = 'new-name' 334 a.name = 'new-name'
335 a.save! 335 a.save!
336 336
337 get :view_page, :profile => p.identifier, :page => old_path 337 get :view_page, :profile => p.identifier, :page => old_path
338 338
339 assert_response :redirect 339 assert_response :redirect
340 - assert_redirected_to :host => p.default_hostname, :controller => 'content_viewer', :action => 'view_page', :profile => p.identifier, :page => a.explode_path 340 + assert_redirected_to :host => p.default_hostname, :controller => 'content_viewer', :action => 'view_page', :profile => p.identifier, :page => a.path
341 end 341 end
342 342
343 should 'load new article name equal of another article old name' do 343 should 'load new article name equal of another article old name' do
344 p = create_user('test_user').person 344 p = create_user('test_user').person
345 a1 = p.articles.create!(:name => 'old-name') 345 a1 = p.articles.create!(:name => 'old-name')
346 - old_path = a1.explode_path 346 + old_path = a1.path
347 a1.name = 'new-name' 347 a1.name = 'new-name'
348 a1.save! 348 a1.save!
349 a2 = p.articles.create!(:name => 'old-name') 349 a2 = p.articles.create!(:name => 'old-name')
@@ -356,7 +356,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -356,7 +356,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
356 should 'redirect to article with most recent version with the name if there is no article with the name' do 356 should 'redirect to article with most recent version with the name if there is no article with the name' do
357 p = create_user('test_user').person 357 p = create_user('test_user').person
358 a1 = p.articles.create!(:name => 'old-name') 358 a1 = p.articles.create!(:name => 'old-name')
359 - old_path = a1.explode_path 359 + old_path = a1.path
360 a1.name = 'new-name' 360 a1.name = 'new-name'
361 a1.save! 361 a1.save!
362 a2 = p.articles.create!(:name => 'old-name') 362 a2 = p.articles.create!(:name => 'old-name')
@@ -366,13 +366,13 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -366,13 +366,13 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
366 get :view_page, :profile => p.identifier, :page => old_path 366 get :view_page, :profile => p.identifier, :page => old_path
367 367
368 assert_response :redirect 368 assert_response :redirect
369 - assert_redirected_to :host => p.default_hostname, :controller => 'content_viewer', :action => 'view_page', :profile => p.identifier, :page => a2.explode_path 369 + assert_redirected_to :host => p.default_hostname, :controller => 'content_viewer', :action => 'view_page', :profile => p.identifier, :page => a2.path
370 end 370 end
371 371
372 should 'not return an article of a different user' do 372 should 'not return an article of a different user' do
373 p1 = create_user('test_user').person 373 p1 = create_user('test_user').person
374 a = p1.articles.create!(:name => 'old-name') 374 a = p1.articles.create!(:name => 'old-name')
375 - old_path = a.explode_path 375 + old_path = a.path
376 a.name = 'new-name' 376 a.name = 'new-name'
377 a.save! 377 a.save!
378 378
@@ -514,7 +514,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -514,7 +514,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
514 should 'not display delete button for homepage' do 514 should 'not display delete button for homepage' do
515 login_as(profile.identifier) 515 login_as(profile.identifier)
516 page = profile.home_page 516 page = profile.home_page
517 - xhr :get, :view_page, :profile => profile.identifier, :page => page.explode_path, :toolbar => true 517 + xhr :get, :view_page, :profile => profile.identifier, :page => page.path, :toolbar => true
518 assert_no_tag :tag => 'a', :content => 'Delete', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/destroy/#{page.id}" } 518 assert_no_tag :tag => 'a', :content => 'Delete', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/destroy/#{page.id}" }
519 end 519 end
520 520
@@ -542,7 +542,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -542,7 +542,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
542 542
543 should 'render html for image when view' do 543 should 'render html for image when view' do
544 file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => profile) 544 file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => profile)
545 - get :view_page, :profile => profile.identifier, :page => file.explode_path, :view => true 545 + get :view_page, :profile => profile.identifier, :page => file.path, :view => true
546 546
547 assert_response :success 547 assert_response :success
548 assert_template 'view_page' 548 assert_template 'view_page'
@@ -550,7 +550,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -550,7 +550,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
550 550
551 should 'download data for image when not view' do 551 should 'download data for image when not view' do
552 file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => profile) 552 file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => profile)
553 - get :view_page, :profile => profile.identifier, :page => file.explode_path 553 + get :view_page, :profile => profile.identifier, :page => file.path
554 554
555 assert_response :success 555 assert_response :success
556 assert_template nil 556 assert_template nil
@@ -559,7 +559,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -559,7 +559,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
559 should "display 'Upload files' when create children of image gallery" do 559 should "display 'Upload files' when create children of image gallery" do
560 login_as(profile.identifier) 560 login_as(profile.identifier)
561 f = Gallery.create!(:name => 'gallery', :profile => profile) 561 f = Gallery.create!(:name => 'gallery', :profile => profile)
562 - xhr :get, :view_page, :profile => profile.identifier, :page => f.explode_path, :toolbar => true 562 + xhr :get, :view_page, :profile => profile.identifier, :page => f.path, :toolbar => true
563 assert_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{f.id}/} 563 assert_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{f.id}/}
564 end 564 end
565 565
@@ -568,7 +568,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -568,7 +568,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
568 folder1 = Gallery.create!(:name => 'gallery1', :profile => profile) 568 folder1 = Gallery.create!(:name => 'gallery1', :profile => profile)
569 folder1.children << folder2 = Folder.new(:name => 'gallery2', :profile => profile) 569 folder1.children << folder2 = Folder.new(:name => 'gallery2', :profile => profile)
570 570
571 - xhr :get, :view_page, :profile => profile.identifier, :page => folder2.explode_path, :toolbar => true 571 + xhr :get, :view_page, :profile => profile.identifier, :page => folder2.path, :toolbar => true
572 assert_tag :tag => 'a', :content => 'New article', :attributes => {:href =>/parent_id=#{folder2.id}/} 572 assert_tag :tag => 'a', :content => 'New article', :attributes => {:href =>/parent_id=#{folder2.id}/}
573 end 573 end
574 574
@@ -576,14 +576,14 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -576,14 +576,14 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
576 login_as(profile.identifier) 576 login_as(profile.identifier)
577 folder = Gallery.create!(:name => 'gallery', :profile => profile) 577 folder = Gallery.create!(:name => 'gallery', :profile => profile)
578 file = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) 578 file = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'))
579 - xhr :get, :view_page, :profile => profile.identifier, :page => file.explode_path, :view => true, :toolbar => true 579 + xhr :get, :view_page, :profile => profile.identifier, :page => file.path, :view => true, :toolbar => true
580 580
581 assert_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{folder.id}/} 581 assert_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{folder.id}/}
582 end 582 end
583 583
584 should 'render slideshow template' do 584 should 'render slideshow template' do
585 f = Folder.create!(:name => 'gallery', :profile => profile) 585 f = Folder.create!(:name => 'gallery', :profile => profile)
586 - get :view_page, :profile => profile.identifier, :page => f.explode_path, :slideshow => true 586 + get :view_page, :profile => profile.identifier, :page => f.path, :slideshow => true
587 587
588 assert_template 'slideshow' 588 assert_template 'slideshow'
589 end 589 end
@@ -595,7 +595,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -595,7 +595,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
595 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg')) 595 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'))
596 image2 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) 596 image2 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'))
597 597
598 - get :view_page, :profile => profile.identifier, :page => folder.explode_path, :slideshow => true 598 + get :view_page, :profile => profile.identifier, :page => folder.path, :slideshow => true
599 599
600 assert_equal 2, assigns(:images).size 600 assert_equal 2, assigns(:images).size
601 end 601 end
@@ -606,7 +606,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -606,7 +606,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
606 folder = Gallery.create!(:name => 'gallery', :profile => owner) 606 folder = Gallery.create!(:name => 'gallery', :profile => owner)
607 image1 = UploadedFile.create!(:profile => owner, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'), :published => false) 607 image1 = UploadedFile.create!(:profile => owner, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'), :published => false)
608 login_as('unauthorized') 608 login_as('unauthorized')
609 - get :view_page, :profile => owner.identifier, :page => folder.explode_path, :slideshow => true 609 + get :view_page, :profile => owner.identifier, :page => folder.path, :slideshow => true
610 assert_response :success 610 assert_response :success
611 assert_equal 0, assigns(:images).length 611 assert_equal 0, assigns(:images).length
612 end 612 end
@@ -617,7 +617,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -617,7 +617,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
617 folder = Gallery.create!(:name => 'gallery', :profile => owner) 617 folder = Gallery.create!(:name => 'gallery', :profile => owner)
618 image1 = UploadedFile.create!(:profile => owner, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'), :published => false) 618 image1 = UploadedFile.create!(:profile => owner, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'), :published => false)
619 login_as('unauthorized') 619 login_as('unauthorized')
620 - get :view_page, :profile => owner.identifier, :page => folder.explode_path 620 + get :view_page, :profile => owner.identifier, :page => folder.path
621 assert_response :success 621 assert_response :success
622 assert_select '.image-gallery-item', 0 622 assert_select '.image-gallery-item', 0
623 end 623 end
@@ -629,7 +629,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -629,7 +629,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
629 629
630 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg')) 630 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'))
631 631
632 - get :view_page, :profile => profile.identifier, :page => folder.explode_path, :slideshow => true 632 + get :view_page, :profile => profile.identifier, :page => folder.path, :slideshow => true
633 633
634 assert_tag :tag => 'img', :attributes => {:src => /\/images\/icons-app\/image-loading-display.png/} 634 assert_tag :tag => 'img', :attributes => {:src => /\/images\/icons-app\/image-loading-display.png/}
635 end 635 end
@@ -641,7 +641,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -641,7 +641,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
641 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg')) 641 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'))
642 642
643 process_delayed_job_queue 643 process_delayed_job_queue
644 - get :view_page, :profile => profile.identifier, :page => folder.explode_path, :slideshow => true 644 + get :view_page, :profile => profile.identifier, :page => folder.path, :slideshow => true
645 645
646 assert_tag :tag => 'img', :attributes => {:src => /other-pic_display.jpg/} 646 assert_tag :tag => 'img', :attributes => {:src => /other-pic_display.jpg/}
647 end 647 end
@@ -652,7 +652,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -652,7 +652,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
652 652
653 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg')) 653 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'))
654 654
655 - get :view_page, :profile => profile.identifier, :page => folder.explode_path 655 + get :view_page, :profile => profile.identifier, :page => folder.path
656 656
657 assert_tag :tag => 'a', :attributes => {:class => 'image', :style => /background-image: url\(\/images\/icons-app\/image-loading-thumb.png\)/} 657 assert_tag :tag => 'a', :attributes => {:class => 'image', :style => /background-image: url\(\/images\/icons-app\/image-loading-thumb.png\)/}
658 end 658 end
@@ -664,7 +664,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -664,7 +664,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
664 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg')) 664 image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'))
665 665
666 process_delayed_job_queue 666 process_delayed_job_queue
667 - get :view_page, :profile => profile.identifier, :page => folder.explode_path 667 + get :view_page, :profile => profile.identifier, :page => folder.path
668 668
669 assert_tag :tag => 'a', :attributes => {:class => 'image', :style => /background-image: url\(.*\/other-pic_thumb.jpg\)/} 669 assert_tag :tag => 'a', :attributes => {:class => 'image', :style => /background-image: url\(.*\/other-pic_thumb.jpg\)/}
670 end 670 end
@@ -690,7 +690,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -690,7 +690,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
690 should "not display 'Upload files' when viewing blog" do 690 should "not display 'Upload files' when viewing blog" do
691 login_as(profile.identifier) 691 login_as(profile.identifier)
692 b = Blog.create!(:name => 'article folder', :profile => profile) 692 b = Blog.create!(:name => 'article folder', :profile => profile)
693 - xhr :get, :view_page, :profile => profile.identifier, :page => b.explode_path, :toolbar => true 693 + xhr :get, :view_page, :profile => profile.identifier, :page => b.path, :toolbar => true
694 assert_no_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{b.id}/} 694 assert_no_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{b.id}/}
695 end 695 end
696 696
@@ -698,7 +698,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -698,7 +698,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
698 login_as(profile.identifier) 698 login_as(profile.identifier)
699 b = Blog.create!(:name => 'article folder', :profile => profile) 699 b = Blog.create!(:name => 'article folder', :profile => profile)
700 blog_post = TextileArticle.create!(:name => 'children-article', :profile => profile, :parent => b) 700 blog_post = TextileArticle.create!(:name => 'children-article', :profile => profile, :parent => b)
701 - xhr :get, :view_page, :profile => profile.identifier, :page => blog_post.explode_path, :toolbar => true 701 + xhr :get, :view_page, :profile => profile.identifier, :page => blog_post.path, :toolbar => true
702 assert_no_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{b.id}/} 702 assert_no_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{b.id}/}
703 end 703 end
704 704
@@ -707,7 +707,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -707,7 +707,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
707 folder = fast_create(Gallery, :profile_id => profile.id) 707 folder = fast_create(Gallery, :profile_id => profile.id)
708 file = UploadedFile.create!(:title => 'my img title', :profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) 708 file = UploadedFile.create!(:title => 'my img title', :profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'))
709 709
710 - get :view_page, :profile => profile.identifier, :page => folder.explode_path 710 + get :view_page, :profile => profile.identifier, :page => folder.path
711 711
712 assert_tag :tag => 'li', :attributes => {:title => 'my img title', :class => 'image-gallery-item'}, :child => {:tag => 'span', :content => 'my img title'} 712 assert_tag :tag => 'li', :attributes => {:title => 'my img title', :class => 'image-gallery-item'}, :child => {:tag => 'span', :content => 'my img title'}
713 end 713 end
@@ -717,7 +717,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -717,7 +717,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
717 folder = fast_create(Gallery, :profile_id => profile.id) 717 folder = fast_create(Gallery, :profile_id => profile.id)
718 file = UploadedFile.create!(:title => '<b>my img title</b>', :profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) 718 file = UploadedFile.create!(:title => '<b>my img title</b>', :profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'))
719 719
720 - get :view_page, :profile => profile.identifier, :page => folder.explode_path 720 + get :view_page, :profile => profile.identifier, :page => folder.path
721 721
722 assert_tag :tag => 'li', :attributes => {:title => 'my img title', :class => 'image-gallery-item'}, :child => {:tag => 'span', :content => 'my img title'} 722 assert_tag :tag => 'li', :attributes => {:title => 'my img title', :class => 'image-gallery-item'}, :child => {:tag => 'span', :content => 'my img title'}
723 end 723 end
@@ -728,7 +728,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -728,7 +728,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
728 login_as u.identifier 728 login_as u.identifier
729 a = create(Article, :profile => c, :name => 'test-article', :last_changed_by => u, :published => false) 729 a = create(Article, :profile => c, :name => 'test-article', :last_changed_by => u, :published => false)
730 730
731 - get :view_page, :profile => c.identifier, :page => a.explode_path 731 + get :view_page, :profile => c.identifier, :page => a.path
732 732
733 assert_response :success 733 assert_response :success
734 assert_template 'view_page' 734 assert_template 'view_page'
@@ -740,7 +740,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -740,7 +740,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
740 login_as u.identifier 740 login_as u.identifier
741 a = create(Article, :profile => c, :name => 'test-article', :last_changed_by => profile, :published => true) 741 a = create(Article, :profile => c, :name => 'test-article', :last_changed_by => profile, :published => true)
742 742
743 - xhr :get, :view_page, :profile => c.identifier, :page => a.explode_path, :toolbar => true 743 + xhr :get, :view_page, :profile => c.identifier, :page => a.path, :toolbar => true
744 744
745 assert_tag :tag => 'a', :content => 'New article' 745 assert_tag :tag => 'a', :content => 'New article'
746 end 746 end
@@ -751,7 +751,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -751,7 +751,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
751 comment = article.comments.create(:author => to_be_removed, :title => 'Test Comment', :body => 'My author does not exist =(') 751 comment = article.comments.create(:author => to_be_removed, :title => 'Test Comment', :body => 'My author does not exist =(')
752 to_be_removed.destroy 752 to_be_removed.destroy
753 753
754 - get :view_page, :profile => profile.identifier, :page => article.explode_path 754 + get :view_page, :profile => profile.identifier, :page => article.path
755 755
756 assert_tag :tag => 'span', :content => '(removed user)', :attributes => {:class => 'comment-user-status icon-user-removed'} 756 assert_tag :tag => 'span', :content => '(removed user)', :attributes => {:class => 'comment-user-status icon-user-removed'}
757 end 757 end
@@ -763,7 +763,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -763,7 +763,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
763 763
764 blog.posts << TinyMceArticle.create!(:name => 'first post', :parent => blog, :profile => profile, :body => '<p>Content to be displayed.</p> Anything') 764 blog.posts << TinyMceArticle.create!(:name => 'first post', :parent => blog, :profile => profile, :body => '<p>Content to be displayed.</p> Anything')
765 765
766 - get :view_page, :profile => profile.identifier, :page => blog.explode_path 766 + get :view_page, :profile => profile.identifier, :page => blog.path
767 767
768 assert_tag :tag => 'div', :attributes => { :class => 'short-post'}, :content => /Content to be displayed./ 768 assert_tag :tag => 'div', :attributes => { :class => 'short-post'}, :content => /Content to be displayed./
769 assert_no_tag :tag => 'div', :attributes => { :class => 'short-post'}, :content => /Anything/ 769 assert_no_tag :tag => 'div', :attributes => { :class => 'short-post'}, :content => /Anything/
@@ -772,7 +772,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -772,7 +772,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
772 should 'display link to edit blog for allowed' do 772 should 'display link to edit blog for allowed' do
773 blog = fast_create(Blog, :profile_id => profile.id, :path => 'blog') 773 blog = fast_create(Blog, :profile_id => profile.id, :path => 'blog')
774 login_as(profile.identifier) 774 login_as(profile.identifier)
775 - xhr :get, :view_page, :profile => profile.identifier, :page => blog.explode_path, :toolbar => true 775 + xhr :get, :view_page, :profile => profile.identifier, :page => blog.path, :toolbar => true
776 assert_tag :tag => 'div', :attributes => { :id => 'article-actions' }, :descendant => { :tag => 'a', :attributes => { :href => "/myprofile/testinguser/cms/edit/#{blog.id}" }, :content => 'Configure blog' } 776 assert_tag :tag => 'div', :attributes => { :id => 'article-actions' }, :descendant => { :tag => 'a', :attributes => { :href => "/myprofile/testinguser/cms/edit/#{blog.id}" }, :content => 'Configure blog' }
777 end 777 end
778 778
@@ -895,7 +895,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -895,7 +895,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
895 should "not display 'Upload files' when viewing forum" do 895 should "not display 'Upload files' when viewing forum" do
896 login_as(profile.identifier) 896 login_as(profile.identifier)
897 b = Forum.create!(:name => 'article folder', :profile => profile) 897 b = Forum.create!(:name => 'article folder', :profile => profile)
898 - xhr :get, :view_page, :profile => profile.identifier, :page => b.explode_path, :toolbar => true 898 + xhr :get, :view_page, :profile => profile.identifier, :page => b.path, :toolbar => true
899 assert_no_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{b.id}/} 899 assert_no_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{b.id}/}
900 end 900 end
901 901
@@ -903,35 +903,35 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -903,35 +903,35 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
903 login_as(profile.identifier) 903 login_as(profile.identifier)
904 b = Forum.create!(:name => 'article folder', :profile => profile) 904 b = Forum.create!(:name => 'article folder', :profile => profile)
905 forum_post = TextileArticle.create!(:name => 'children-article', :profile => profile, :parent => b) 905 forum_post = TextileArticle.create!(:name => 'children-article', :profile => profile, :parent => b)
906 - xhr :get, :view_page, :profile => profile.identifier, :page => forum_post.explode_path, :toolbar => true 906 + xhr :get, :view_page, :profile => profile.identifier, :page => forum_post.path, :toolbar => true
907 assert_no_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{b.id}/} 907 assert_no_tag :tag => 'a', :content => 'Upload files', :attributes => {:href => /parent_id=#{b.id}/}
908 end 908 end
909 909
910 should 'display link to edit forum for allowed' do 910 should 'display link to edit forum for allowed' do
911 forum = fast_create(Forum, :profile_id => profile.id, :path => 'forum') 911 forum = fast_create(Forum, :profile_id => profile.id, :path => 'forum')
912 login_as(profile.identifier) 912 login_as(profile.identifier)
913 - xhr :get, :view_page, :profile => profile.identifier, :page => forum.explode_path, :toolbar => true 913 + xhr :get, :view_page, :profile => profile.identifier, :page => forum.path, :toolbar => true
914 assert_tag :tag => 'div', :attributes => { :id => 'article-actions' }, :descendant => { :tag => 'a', :attributes => { :href => "/myprofile/testinguser/cms/edit/#{forum.id}" }, :content => 'Configure forum' } 914 assert_tag :tag => 'div', :attributes => { :id => 'article-actions' }, :descendant => { :tag => 'a', :attributes => { :href => "/myprofile/testinguser/cms/edit/#{forum.id}" }, :content => 'Configure forum' }
915 end 915 end
916 916
917 should 'display add translation link if article is translatable' do 917 should 'display add translation link if article is translatable' do
918 login_as @profile.identifier 918 login_as @profile.identifier
919 textile = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'textile', :language => 'en') 919 textile = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'textile', :language => 'en')
920 - xhr :get, :view_page, :profile => @profile.identifier, :page => textile.explode_path, :toolbar => true  
921 - assert_tag :a, :attributes => { :href => "/myprofile/#{profile.identifier}/cms/new?article%5Btranslation_of_id%5D=#{textile.id}&amp;type=#{TextileArticle}" } 920 + xhr :get, :view_page, :profile => @profile.identifier, :page => textile.path, :toolbar => true
  921 + assert_tag :a, :attributes => { :href => "/myprofile/#{profile.identifier}/cms/new?article%5Btranslation_of_id%5D=#{textile.id}&type=#{TextileArticle}" }
922 end 922 end
923 923
924 should 'not display add translation link if article is not translatable' do 924 should 'not display add translation link if article is not translatable' do
925 login_as @profile.identifier 925 login_as @profile.identifier
926 blog = fast_create(Blog, :profile_id => @profile.id, :path => 'blog') 926 blog = fast_create(Blog, :profile_id => @profile.id, :path => 'blog')
927 - xhr :get, :view_page, :profile => @profile.identifier, :page => blog.explode_path, :toolbar => true 927 + xhr :get, :view_page, :profile => @profile.identifier, :page => blog.path, :toolbar => true
928 assert_no_tag :a, :attributes => { :content => 'Add translation', :class => /icon-locale/ } 928 assert_no_tag :a, :attributes => { :content => 'Add translation', :class => /icon-locale/ }
929 end 929 end
930 930
931 should 'not display add translation link if article hasnt a language defined' do 931 should 'not display add translation link if article hasnt a language defined' do
932 login_as @profile.identifier 932 login_as @profile.identifier
933 textile = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'textile') 933 textile = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'textile')
934 - xhr :get, :view_page, :profile => @profile.identifier, :page => textile.explode_path, :toolbar => true 934 + xhr :get, :view_page, :profile => @profile.identifier, :page => textile.path, :toolbar => true
935 assert_no_tag :a, :attributes => { :content => 'Add translation', :class => /icon-locale/ } 935 assert_no_tag :a, :attributes => { :content => 'Add translation', :class => /icon-locale/ }
936 end 936 end
937 937
@@ -939,7 +939,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -939,7 +939,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
939 login_as @profile.identifier 939 login_as @profile.identifier
940 textile = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'textile', :language => 'en') 940 textile = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'textile', :language => 'en')
941 translation = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'translation', :language => 'es', :translation_of_id => textile) 941 translation = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'translation', :language => 'es', :translation_of_id => textile)
942 - xhr :get, :view_page, :profile => @profile.identifier, :page => textile.explode_path, :toolbar => true 942 + xhr :get, :view_page, :profile => @profile.identifier, :page => textile.path, :toolbar => true
943 assert_tag :a, :attributes => { :class => /article-translations-menu/, :onmouseover => /toggleSubmenu/ } 943 assert_tag :a, :attributes => { :class => /article-translations-menu/, :onmouseover => /toggleSubmenu/ }
944 end 944 end
945 945
@@ -948,7 +948,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -948,7 +948,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
948 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :translation_of_id => en_article) 948 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :translation_of_id => en_article)
949 @request.env['HTTP_REFERER'] = "http://localhost:3000/#{@profile.identifier}/#{es_article.path}" 949 @request.env['HTTP_REFERER'] = "http://localhost:3000/#{@profile.identifier}/#{es_article.path}"
950 FastGettext.stubs(:locale).returns('es') 950 FastGettext.stubs(:locale).returns('es')
951 - get :view_page, :profile => @profile.identifier, :page => es_article.explode_path 951 + get :view_page, :profile => @profile.identifier, :page => es_article.path
952 assert_response :success 952 assert_response :success
953 assert_equal es_article, assigns(:page) 953 assert_equal es_article, assigns(:page)
954 end 954 end
@@ -956,7 +956,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -956,7 +956,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
956 should 'not be redirected if article does not have a language' do 956 should 'not be redirected if article does not have a language' do
957 FastGettext.stubs(:locale).returns('es') 957 FastGettext.stubs(:locale).returns('es')
958 article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'article') 958 article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'article')
959 - get :view_page, :profile => @profile.identifier, :page => article.explode_path 959 + get :view_page, :profile => @profile.identifier, :page => article.path
960 assert_response :success 960 assert_response :success
961 assert_equal article, assigns(:page) 961 assert_equal article, assigns(:page)
962 end 962 end
@@ -966,7 +966,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -966,7 +966,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
966 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :translation_of_id => en_article) 966 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :translation_of_id => en_article)
967 @request.env['HTTP_REFERER'] = "http://localhost:3000/#{@profile.identifier}/#{es_article.path}" 967 @request.env['HTTP_REFERER'] = "http://localhost:3000/#{@profile.identifier}/#{es_article.path}"
968 FastGettext.stubs(:locale).returns('es') 968 FastGettext.stubs(:locale).returns('es')
969 - get :view_page, :profile => @profile.identifier, :page => en_article.explode_path 969 + get :view_page, :profile => @profile.identifier, :page => en_article.path
970 assert_response :success 970 assert_response :success
971 assert_equal en_article, assigns(:page) 971 assert_equal en_article, assigns(:page)
972 end 972 end
@@ -976,7 +976,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -976,7 +976,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
976 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :translation_of_id => en_article) 976 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :translation_of_id => en_article)
977 FastGettext.stubs(:locale).returns('es') 977 FastGettext.stubs(:locale).returns('es')
978 @request.env['HTTP_REFERER'] = "http://localhost/myprofile/#{@profile.identifier}/cms/edit/#{en_article.id}" 978 @request.env['HTTP_REFERER'] = "http://localhost/myprofile/#{@profile.identifier}/cms/edit/#{en_article.id}"
979 - get :view_page, :profile => @profile.identifier, :page => es_article.explode_path 979 + get :view_page, :profile => @profile.identifier, :page => es_article.path
980 assert_response :success 980 assert_response :success
981 assert_equal es_article, assigns(:page) 981 assert_equal es_article, assigns(:page)
982 end 982 end
@@ -986,7 +986,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -986,7 +986,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
986 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :translation_of_id => en_article) 986 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :translation_of_id => en_article)
987 FastGettext.stubs(:locale).returns('es') 987 FastGettext.stubs(:locale).returns('es')
988 @request.env['HTTP_REFERER'] = "http://localhost/myprofile/#{@profile.identifier}/cms/new" 988 @request.env['HTTP_REFERER'] = "http://localhost/myprofile/#{@profile.identifier}/cms/new"
989 - get :view_page, :profile => @profile.identifier, :page => es_article.explode_path 989 + get :view_page, :profile => @profile.identifier, :page => es_article.path
990 assert_response :success 990 assert_response :success
991 assert_equal es_article, assigns(:page) 991 assert_equal es_article, assigns(:page)
992 end 992 end
@@ -999,7 +999,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -999,7 +999,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
999 en_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'en_article', :language => 'en', :parent_id => blog.id) 999 en_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'en_article', :language => 'en', :parent_id => blog.id)
1000 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :parent_id => blog.id, :translation_of_id => en_article) 1000 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :parent_id => blog.id, :translation_of_id => en_article)
1001 1001
1002 - get :view_page, :profile => @profile.identifier, :page => blog.explode_path 1002 + get :view_page, :profile => @profile.identifier, :page => blog.path
1003 assert_tag :div, :attributes => { :id => "post-#{es_article.id}" } 1003 assert_tag :div, :attributes => { :id => "post-#{es_article.id}" }
1004 assert_no_tag :div, :attributes => { :id => "post-#{en_article.id}" } 1004 assert_no_tag :div, :attributes => { :id => "post-#{en_article.id}" }
1005 end 1005 end
@@ -1017,7 +1017,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -1017,7 +1017,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
1017 es_article2 = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :parent_id => blog.id, :translation_of_id => en_article2) 1017 es_article2 = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :parent_id => blog.id, :translation_of_id => en_article2)
1018 1018
1019 1019
1020 - get :view_page, :profile => @profile.identifier, :page => blog.explode_path 1020 + get :view_page, :profile => @profile.identifier, :page => blog.path
1021 1021
1022 assert_equal [pt_article], assigns(:posts) 1022 assert_equal [pt_article], assigns(:posts)
1023 end 1023 end
@@ -1042,7 +1042,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase @@ -1042,7 +1042,7 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
1042 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :parent_id => blog.id, :translation_of_id => en_article) 1042 es_article = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'es_article', :language => 'es', :parent_id => blog.id, :translation_of_id => en_article)
1043 blog.posts = [en_article, es_article] 1043 blog.posts = [en_article, es_article]
1044 1044
1045 - get :view_page, :profile => @profile.identifier, :page => blog.explode_path 1045 + get :view_page, :profile => @profile.identifier, :page => blog.path
1046 assert_equal [es_article], assigns(:posts) 1046 assert_equal [es_article], assigns(:posts)
1047 end 1047 end
1048 1048
vendor/plugins/xss_terminate/lib/xss_terminate.rb
@@ -59,7 +59,8 @@ module XssTerminate @@ -59,7 +59,8 @@ module XssTerminate
59 else 59 else
60 value = self.send("#{field}") 60 value = self.send("#{field}")
61 return unless value 61 return unless value
62 - self.send("#{field}=", sanitizer.sanitize(value)) 62 + value = sanitizer.sanitize(value)
  63 + self.send("#{field}=", value)
63 64
64 if with == :full 65 if with == :full
65 self.send("#{field}=", CGI.escapeHTML(value)) 66 self.send("#{field}=", CGI.escapeHTML(value))