Commit 123e29ff70d66391d07b4bb61ab21c5e2c787288
1 parent
7893db97
Exists in
master
and in
29 other branches
ActionItem16: complementing integration test
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@891 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
16 additions
and
4 deletions
Show diff stats
test/integration/enterprise_registration_test.rb
@@ -4,7 +4,6 @@ class EnterpriseRegistrationTest < ActionController::IntegrationTest | @@ -4,7 +4,6 @@ class EnterpriseRegistrationTest < ActionController::IntegrationTest | ||
4 | 4 | ||
5 | fixtures :users, :profiles, :environments | 5 | fixtures :users, :profiles, :environments |
6 | 6 | ||
7 | - # Replace this with your real tests. | ||
8 | should 'be able to create an enterprise registration request' do | 7 | should 'be able to create an enterprise registration request' do |
9 | 8 | ||
10 | environment = Environment.default | 9 | environment = Environment.default |
@@ -42,10 +41,23 @@ class EnterpriseRegistrationTest < ActionController::IntegrationTest | @@ -42,10 +41,23 @@ class EnterpriseRegistrationTest < ActionController::IntegrationTest | ||
42 | 41 | ||
43 | assert_tag :tag => 'a', :attributes => { :href => '/' } | 42 | assert_tag :tag => 'a', :attributes => { :href => '/' } |
44 | 43 | ||
45 | - # FIXME: add here | ||
46 | - # - the steps carried on by the validator organization to approve the registration | ||
47 | - # - the steps carried on by the requestor after that | 44 | + code = CreateEnterprise.find(:first, :order => 'id desc').code |
48 | 45 | ||
46 | + # steps done by the validator | ||
47 | + get "/myprofile/myorg/enterprise_validation" | ||
48 | + assert_response :success | ||
49 | + assert_tag :tag => 'a', :attributes => { :href => "/myprofile/myorg/enterprise_validation/details/#{code}" } | ||
50 | + | ||
51 | + get "/myprofile/myorg/enterprise_validation/details/#{code}" | ||
52 | + assert_response :success | ||
53 | + assert_tag :form, :attributes => { :action => "/myprofile/myorg/enterprise_validation/approve/#{code}" } | ||
54 | + | ||
55 | + post "/myprofile/myorg/enterprise_validation/approve/#{code}" | ||
56 | + assert_response :redirect | ||
57 | + | ||
58 | + follow_redirect! | ||
59 | + assert_equal "/myprofile/myorg/enterprise_validation/view_processed/#{code}", path | ||
60 | + assert_tag :span, :content => 'Approved' | ||
49 | end | 61 | end |
50 | 62 | ||
51 | end | 63 | end |