Commit ce4f6b731e27bd64433aff78c237cd993b7559e8

Authored by Cyril Mougel
1 parent 24980223
Exists in master and in 1 other branch production

Fix issue of failed page to create apps

The page to create an apps failed.

Fix #586
app/views/apps/_fields.html.haml
... ... @@ -4,10 +4,11 @@
4 4 = f.label :name
5 5 = f.text_field :name
6 6  
7   -%div
8   - %label Api Key
9   - %span= app.api_key
10   - = link_to t('.regenerate_api_key'), regenerate_api_key_app_path(app), :class => 'button', :method => 'post'
  7 +- unless app.new_record?
  8 + %div
  9 + %label Api Key
  10 + %span= app.api_key
  11 + = link_to t('.regenerate_api_key'), regenerate_api_key_app_path(app), :class => 'button', :method => 'post'
11 12 %div
12 13 = f.label :repository_branch
13 14 = f.text_field :repository_branch, :placeholder => "master"
... ...
spec/acceptance/app_regenerate_api_key_spec.rb
... ... @@ -17,6 +17,9 @@ feature "Regeneration api_Key" do
17 17 }.to change {
18 18 app.reload.api_key
19 19 }
  20 + click_link I18n.t('shared.navigation.apps')
  21 + click_link I18n.t('apps.index.new_app')
  22 + expect(page).to_not have_button I18n.t('apps.fields.regenerate_api_key')
20 23 end
21 24  
22 25 scenario "a user cannot access to edit page" do
... ...