<% unless flash[:notice].nil? %>
<%= flash[:notice] %>
diff --git a/config/routes.rb b/config/routes.rb
index 7032d27..27180e4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -54,7 +54,6 @@ ActionController::Routing::Routes.draw do |map|
## Public controllers
######################################################
- map.profile 'profile/:profile/:controller', :controller => 'profile'
# *content viewing*
# XXX this route must come last so other routes have priority over it.
map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page'
diff --git a/test/integration/manage_documents_test.rb b/test/integration/manage_documents_test.rb
index ad3cd33..9c1d580 100644
--- a/test/integration/manage_documents_test.rb
+++ b/test/integration/manage_documents_test.rb
@@ -9,9 +9,12 @@ class ManageDocumentsTest < ActionController::IntegrationTest
login('ze', 'test')
+ assert_tag :tag => 'a', :attributes => { :href => '/myprofile/ze/cms' }
+
get '/myprofile/ze/cms'
assert_response :success
+ assert_tag :tag => 'a', :attributes => { :href => '/myprofile/ze/cms/new' }
get '/myprofile/ze/cms/new'
assert_response :success
assert_tag :tag => 'form', :attributes => { :action => '/myprofile/ze/cms/new' }
@@ -21,6 +24,7 @@ class ManageDocumentsTest < ActionController::IntegrationTest
follow_redirect!
assert_response :success
+ assert_equal '/myprofile/ze/cms', path
assert_equal count + 1, Article.count
@@ -39,18 +43,24 @@ class ManageDocumentsTest < ActionController::IntegrationTest
post "myprofile/ze/cms/edit/#{id}", :page => { :body => 'changed_body' }
assert_response :redirect
+ follow_redirect!
+ assert_equal '/myprofile/ze/cms', path
end
def test_removing_an_article
+
article = Article.create!(:title => 'to be removed', :body => 'go to hell', :parent_id => Article.find_by_path('ze').id)
count = Article.count
get '/myprofile/ze/cms'
assert_response :success
+ assert_tag :tag => 'a', :attributes => { :href => "/myprofile/ze/cms/delete/#{article.id}" }
post "/myprofile/ze/cms/delete/#{article.id}"
assert_response :redirect
+ follow_redirect!
+ assert_equal '/myprofile/ze/cms', path
assert_raise ActiveRecord::RecordNotFound do
Article.find(article.id)
diff --git a/test/unit/profile_helper_test.rb b/test/unit/profile_helper_test.rb
index 81a49a6..cd4ee85 100644
--- a/test/unit/profile_helper_test.rb
+++ b/test/unit/profile_helper_test.rb
@@ -3,14 +3,14 @@ require File.dirname(__FILE__) + '/../test_helper'
class ProfileHelperTest < Test::Unit::TestCase
def setup
- @profile = Profile.new
+ @profile = mock
@helper = mock
helper.extend(ProfileHelper)
end
attr_reader :profile, :helper
def test_should_ignore_nil
- profile.stubs(:info).returns(nil)
+ profile.expects(:info).returns(nil)
helper.expects(:content_tag)
helper.expects(:_)
--
libgit2 0.21.2