Commit 7b7083b7828104d8a0e73a09647a236f1c2bc3cf
1 parent
394ec6d8
Exists in
master
and in
28 other branches
ActionItem154: testing response before testing contents
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1186 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
10 additions
and
9 deletions
Show diff stats
test/integration/manage_documents_test.rb
@@ -8,16 +8,18 @@ class ManageDocumentsTest < ActionController::IntegrationTest | @@ -8,16 +8,18 @@ class ManageDocumentsTest < ActionController::IntegrationTest | ||
8 | create_user('myuser') | 8 | create_user('myuser') |
9 | 9 | ||
10 | login('myuser', 'myuser') | 10 | login('myuser', 'myuser') |
11 | - | ||
12 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser' } | 11 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser' } |
12 | + | ||
13 | get '/myprofile/myuser' | 13 | get '/myprofile/myuser' |
14 | - | 14 | + assert_response :success |
15 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser/cms' } | 15 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser/cms' } |
16 | - get '/myprofile/myuser/cms/new' | ||
17 | 16 | ||
17 | + get '/myprofile/myuser/cms/new' | ||
18 | + assert_response :success | ||
18 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser/cms/new?type=TinyMceArticle' } | 19 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser/cms/new?type=TinyMceArticle' } |
19 | - get '/myprofile/myuser/cms/new?type=TinyMceArticle' | ||
20 | 20 | ||
21 | + get '/myprofile/myuser/cms/new?type=TinyMceArticle' | ||
22 | + assert_response :success | ||
21 | assert_tag :tag => 'form', :attributes => { :action => '/myprofile/myuser/cms/new', :method => /post/i } | 23 | assert_tag :tag => 'form', :attributes => { :action => '/myprofile/myuser/cms/new', :method => /post/i } |
22 | 24 | ||
23 | assert_difference Article, :count do | 25 | assert_difference Article, :count do |
@@ -36,23 +38,22 @@ class ManageDocumentsTest < ActionController::IntegrationTest | @@ -36,23 +38,22 @@ class ManageDocumentsTest < ActionController::IntegrationTest | ||
36 | article.save! | 38 | article.save! |
37 | 39 | ||
38 | login('myuser', 'myuser') | 40 | login('myuser', 'myuser') |
39 | - | ||
40 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser' } | 41 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser' } |
42 | + | ||
41 | get '/myprofile/myuser' | 43 | get '/myprofile/myuser' |
42 | assert_response :success | 44 | assert_response :success |
43 | - | ||
44 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser/cms' } | 45 | assert_tag :tag => 'a', :attributes => { :href => '/myprofile/myuser/cms' } |
46 | + | ||
45 | get '/myprofile/myuser/cms' | 47 | get '/myprofile/myuser/cms' |
46 | assert_response :success | 48 | assert_response :success |
47 | - | ||
48 | assert_tag :tag => 'a', :attributes => { :href => "/myprofile/myuser/cms/view/#{article.id}"} | 49 | assert_tag :tag => 'a', :attributes => { :href => "/myprofile/myuser/cms/view/#{article.id}"} |
50 | + | ||
49 | get "/myprofile/myuser/cms/view/#{article.id}" | 51 | get "/myprofile/myuser/cms/view/#{article.id}" |
50 | assert_response :success | 52 | assert_response :success |
51 | - | ||
52 | assert_tag :tag => 'a', :attributes => { :href => "/myprofile/myuser/cms/edit/#{article.id}"} | 53 | assert_tag :tag => 'a', :attributes => { :href => "/myprofile/myuser/cms/edit/#{article.id}"} |
54 | + | ||
53 | get "/myprofile/myuser/cms/edit/#{article.id}" | 55 | get "/myprofile/myuser/cms/edit/#{article.id}" |
54 | assert_response :success | 56 | assert_response :success |
55 | - | ||
56 | assert_tag :tag => 'form', :attributes => { :action => "/myprofile/myuser/cms/edit/#{article.id}", :method => /post/i } | 57 | assert_tag :tag => 'form', :attributes => { :action => "/myprofile/myuser/cms/edit/#{article.id}", :method => /post/i } |
57 | 58 | ||
58 | assert_no_difference Article, :count do | 59 | assert_no_difference Article, :count do |