Commit 5c70980ce50d1213cb4df5c266d1823155cdb3fa
1 parent
a237136f
Exists in
master
and in
27 other branches
[template-welcome-page] Enterprise template welcome page
Showing
2 changed files
with
26 additions
and
7 deletions
Show diff stats
app/views/enterprise_registration/creation.html.erb
1 | -<h1><%= _('Enterprise registration completed') %></h1> | |
1 | +<h1><%= __('Enterprise registration completed') %></h1> | |
2 | +<p><%= __("Your enterprise (%s) was successfully registered.") % @enterprise.name %></p> | |
3 | +<p><%= link_to __('You can manage your enterprise now.'), @enterprise.admin_url %></p> | |
2 | 4 | |
3 | -<p> | |
4 | -<%= _("Your enterprise (%s) was successfully registered.") % @enterprise.name %> | |
5 | -</p> | |
5 | +<%= render :partial => 'shared/template_welcome_page', :locals => {:template => @enterprise.template, :header => _("What can I do with a %s?")} %> | |
6 | + | |
7 | +<% button_bar do %> | |
8 | + <%= button :back, _('Back'), {:controller => 'memberships', :action => 'index', :profile => user.identifier} %> | |
9 | +<% end %> | |
6 | 10 | |
7 | -<p> | |
8 | -<%= link_to _('You can manage your enterprise now.'), @enterprise.admin_url %> | |
9 | -</p> | ... | ... |
test/functional/enterprise_registration_controller_test.rb
... | ... | @@ -55,6 +55,24 @@ class EnterpriseRegistrationControllerTest < ActionController::TestCase |
55 | 55 | assert_template 'creation' |
56 | 56 | end |
57 | 57 | |
58 | + should 'show template welcome page on creation view' do | |
59 | + env = Environment.default | |
60 | + env.organization_approval_method = :none | |
61 | + env.save | |
62 | + region = fast_create(Region, {}) | |
63 | + | |
64 | + template = Enterprise.create!(:name => 'Enterprise Template', :identifier => 'enterprise-template', :is_template => true) | |
65 | + welcome_page = TinyMceArticle.create!(:name => 'Welcome Page', :profile => template, :body => 'This is the welcome page of enterprise template.', :published => true) | |
66 | + template.welcome_page = welcome_page | |
67 | + template.save! | |
68 | + | |
69 | + data = { :name => 'My new enterprise', :identifier => 'mynew', :region => region, :template_id => template.id } | |
70 | + create_enterprise = CreateEnterprise.new(data) | |
71 | + | |
72 | + post :index, :create_enterprise => data | |
73 | + assert_match /#{welcome_page.body}/, @response.body | |
74 | + end | |
75 | + | |
58 | 76 | should 'prompt for selecting validator if approval method is region' do |
59 | 77 | env = Environment.default |
60 | 78 | env.organization_approval_method = :region | ... | ... |