diff --git a/test/integration/manage_documents_test.rb b/test/integration/manage_documents_test.rb index e79cb4d..234a09b 100644 --- a/test/integration/manage_documents_test.rb +++ b/test/integration/manage_documents_test.rb @@ -5,8 +5,26 @@ class ManageDocumentsTest < ActionController::IntegrationTest all_fixtures def test_creation_of_a_new_article - # FIXME - fail 'need to be rewritten' + create_user('myuser') + + login('myuser', 'myuser') + + assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser' } + get '/myprofile/myuser' + + assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser/cms' } + get '/myprofile/myuser/cms/new' + + assert_tag :tag => 'form', :attributes => { :action => '/myprofile/myuser/cms/new', :method => /post/i } + + assert_difference Article, :count do + post '/myprofile/myuser/cms/new', :article => { :name => 'my article', :body => 'this is the body of ther article'} + end + + assert_response :redirect + follow_redirect! + a = Article.find_by_path('my-article') + assert_equal "/myprofile/myuser/cms/view/#{a.id}", path end def test_update_of_an_existing_article -- libgit2 0.21.2