Skip to content

Commit

Permalink
Fix issue of failed page to create apps
Browse files Browse the repository at this point in the history
The page to create an apps failed.

Fix errbit#586
  • Loading branch information
shingara committed Oct 15, 2013
1 parent 2498022 commit ce4f6b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/views/apps/_fields.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
= f.label :name
= f.text_field :name

%div
%label Api Key
%span= app.api_key
= link_to t('.regenerate_api_key'), regenerate_api_key_app_path(app), :class => 'button', :method => 'post'
- unless app.new_record?
%div
%label Api Key
%span= app.api_key
= link_to t('.regenerate_api_key'), regenerate_api_key_app_path(app), :class => 'button', :method => 'post'
%div
= f.label :repository_branch
= f.text_field :repository_branch, :placeholder => "master"
Expand Down
3 changes: 3 additions & 0 deletions spec/acceptance/app_regenerate_api_key_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
}.to change {
app.reload.api_key
}
click_link I18n.t('shared.navigation.apps')
click_link I18n.t('apps.index.new_app')
expect(page).to_not have_button I18n.t('apps.fields.regenerate_api_key')
end

scenario "a user cannot access to edit page" do
Expand Down

0 comments on commit ce4f6b7

Please sign in to comment.