Commit 0386fbf5a8bce7eeaa08308cd6f33c8722345a76
1 parent
b0a90fef
Exists in
master
and in
28 other branches
ActionItem2: added integration test to the activation of an enterprise
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@359 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
27 additions
and
0 deletions
Show diff stats
app/views/enterprise/show.rhtml
@@ -21,3 +21,5 @@ | @@ -21,3 +21,5 @@ | ||
21 | <%= help _('Remove the enterprise from the system') %> | 21 | <%= help _('Remove the enterprise from the system') %> |
22 | <%= link_to _('Affiliate'), :action => 'affiliate' unless @my_enterprises.include?(@enterprise) %> | 22 | <%= link_to _('Affiliate'), :action => 'affiliate' unless @my_enterprises.include?(@enterprise) %> |
23 | <%= help _('Be a member of the enterprise') %> | 23 | <%= help _('Be a member of the enterprise') %> |
24 | +<%= link_to _('Activate'), :action => 'activate', :id => @enterprise if @my_pending_enterprises.include?(@enterprise) %> | ||
25 | +<%= help _('Activate an approved enterprise') if @my_pending_enterprises.include?(@enterprise) %> |
@@ -0,0 +1,25 @@ | @@ -0,0 +1,25 @@ | ||
1 | +require "#{File.dirname(__FILE__)}/../test_helper" | ||
2 | + | ||
3 | +class ActivateEnterpriseTest < ActionController::IntegrationTest | ||
4 | + all_fixtures | ||
5 | + | ||
6 | + def test_activate_approved_enterprise | ||
7 | + login('ze', 'test') | ||
8 | + | ||
9 | + get '/admin/enterprise' | ||
10 | + assert_response :redirect | ||
11 | + | ||
12 | + follow_redirect! | ||
13 | + assert_response :success | ||
14 | + assert_tag :tag => 'a', :attributes => {:href => '/admin/enterprise/activate/5'} | ||
15 | + | ||
16 | + post '/admin/enterprise/activate/5' | ||
17 | + assert_response :redirect | ||
18 | + | ||
19 | + follow_redirect! | ||
20 | + assert_response :redirect | ||
21 | + | ||
22 | + follow_redirect! | ||
23 | + assert_response :success | ||
24 | + end | ||
25 | +end |