Increased test coverage

This commit is contained in:
Dmitriy Zaporozhets 2012-11-21 07:14:05 +03:00
parent e9be4b375b
commit f614ae8ef7
7 changed files with 84 additions and 42 deletions

View file

@ -6,12 +6,12 @@
.right
- unless @project.empty_repo?
- if can? current_user, :download_code, @project
= link_to archive_project_repository_path(@project), class: "btn grouped" do
= link_to archive_project_repository_path(@project), class: "btn-small btn grouped" do
%i.icon-download-alt
Download
- if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
= link_to new_project_merge_request_path(@project), title: "New Merge Request", class: "btn grouped" do
= link_to new_project_merge_request_path(@project), title: "New Merge Request", class: "btn-small btn grouped" do
Merge Request
- if @project.issues_enabled && can?(current_user, :write_issue, @project)
= link_to new_project_issue_path(@project), title: "New Issue", class: "btn grouped" do
= link_to new_project_issue_path(@project), title: "New Issue", class: "btn-small btn grouped" do
Issue

View file

@ -1,27 +1,27 @@
%h3= @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}"
%h3.page_title
= @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}"
%hr
= form_for [@project, @snippet] do |f|
%table.no-borders
-if @snippet.errors.any?
.alert-message.block-message.error
%ul
- @snippet.errors.full_messages.each do |msg|
%li= msg
-if @snippet.errors.any?
.alert-message.block-message.error
%ul
- @snippet.errors.full_messages.each do |msg|
%li= msg
.clearfix
= f.label :title
.input= f.text_field :title, placeholder: "Example Snippet"
.clearfix
= f.label :file_name
.input= f.text_field :file_name, placeholder: "example.rb"
.clearfix
= f.label "Lifetime"
.input= f.select :expires_at, lifetime_select_options, {}, {class: 'chosen span2'}
.clearfix
= f.label :content, "Code"
.input= f.text_area :content, class: "span8"
.clearfix
= f.label :title
.input= f.text_field :title, placeholder: "Example Snippet"
.clearfix
= f.label :file_name
.input= f.text_field :file_name, placeholder: "example.rb"
.clearfix
= f.label "Lifetime"
.input= f.select :expires_at, lifetime_select_options, {}, {class: 'chosen span2'}
.clearfix
= f.label :content, "Code"
.input= f.text_area :content, class: "span8"
.actions
.form-actions
= f.submit 'Save', class: "primary btn"
= link_to "Cancel", project_snippets_path(@project), class: " btn"
- unless @snippet.new_record?