Commit 3a3f0bf4 authored by Annabel Dunstone's avatar Annabel Dunstone

Change build icons into buttons; update tests

parent fc20639c
......@@ -252,7 +252,8 @@
background: linear-gradient(180deg, $white-light 25%, $gray-light 100%);
}
.btn-refresh {
.btn-build {
margin-left: 10px;
i {
color: $gl-icon-color;
}
......
......@@ -91,8 +91,4 @@ table.builds {
color: $gl-dark-link-color;
}
}
.btn-refresh {
margin-left: 10px;
}
}
......@@ -61,12 +61,12 @@
%td
.pull-right
- if can?(current_user, :read_build, project) && build.artifacts?
= link_to download_namespace_project_build_artifacts_path(build.project.namespace, build.project, build), title: 'Download artifacts' do
= link_to download_namespace_project_build_artifacts_path(build.project.namespace, build.project, build), title: 'Download artifacts', class: 'btn btn-build' do
%i.fa.fa-download
- if can?(current_user, :update_build, build.project)
- if build.active?
= link_to cancel_namespace_project_build_path(build.project.namespace, build.project, build, return_to: request.original_url), method: :post, title: 'Cancel' do
= link_to cancel_namespace_project_build_path(build.project.namespace, build.project, build, return_to: request.original_url), method: :post, title: 'Cancel', class: 'btn btn-build' do
%i.fa.fa-remove.cred
- elsif defined?(allow_retry) && allow_retry && build.retryable?
= link_to retry_namespace_project_build_path(build.project.namespace, build.project, build, return_to: request.original_url), method: :post, title: 'Retry', class: 'btn btn-refresh' do
= link_to retry_namespace_project_build_path(build.project.namespace, build.project, build, return_to: request.original_url), method: :post, title: 'Retry', class: 'btn btn-build' do
%i.fa.fa-refresh
......@@ -69,12 +69,12 @@
%td
.pull-right
- if can?(current_user, :read_build, build) && build.artifacts?
= link_to download_namespace_project_build_artifacts_path(build.project.namespace, build.project, build), title: 'Download artifacts' do
= link_to download_namespace_project_build_artifacts_path(build.project.namespace, build.project, build), title: 'Download artifacts', class: 'btn btn-build' do
%i.fa.fa-download
- if can?(current_user, :update_build, build)
- if build.active?
= link_to cancel_namespace_project_build_path(build.project.namespace, build.project, build, return_to: request.original_url), method: :post, title: 'Cancel' do
= link_to cancel_namespace_project_build_path(build.project.namespace, build.project, build, return_to: request.original_url), method: :post, title: 'Cancel', class: 'btn btn-build' do
%i.fa.fa-remove.cred
- elsif defined?(allow_retry) && allow_retry && build.retryable?
= link_to retry_namespace_project_build_path(build.project.namespace, build.project, build, return_to: request.original_url), method: :post, title: 'Retry', class: 'btn btn-refresh' do
= link_to retry_namespace_project_build_path(build.project.namespace, build.project, build, return_to: request.original_url), method: :post, title: 'Retry', class: 'btn btn-build' do
%i.fa.fa-refresh
......@@ -135,7 +135,7 @@ Feature: Project Merge Requests
And I leave a comment like "Line is wrong" on diff
And I switch to the merge request's comments tab
Then I should see a discussion has started on diff
And I should see a badge of "1" next to the discussion link
And I should see a badge of "(1)" next to the discussion link
@javascript
Scenario: I see a new comment on merge request diff from another user in the discussion tab
......@@ -143,7 +143,7 @@ Feature: Project Merge Requests
And I visit merge request page "Bug NS-05"
And user "John Doe" leaves a comment like "Line is wrong" on diff
Then I should see a discussion by user "John Doe" has started on diff
And I should see a badge of "1" next to the discussion link
And I should see a badge of "(1)" next to the discussion link
@javascript
Scenario: I edit a comment on a merge request diff
......@@ -161,11 +161,11 @@ Feature: Project Merge Requests
And I visit merge request page "Bug NS-05"
And I click on the Changes tab
And I leave a comment like "Line is wrong" on diff
And I should see a badge of "1" next to the discussion link
And I should see a badge of "(1)" next to the discussion link
And I delete the comment "Line is wrong" on diff
And I click on the Discussion tab
Then I should not see any discussion
And I should see a badge of "0" next to the discussion link
And I should see a badge of "(0)" next to the discussion link
@javascript
Scenario: I comment on a line of a commit in merge request
......
......@@ -27,8 +27,8 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
step 'I should see todos assigned to me' do
page.within('.nav-sidebar') { expect(page).to have_content 'Todos 4' }
expect(page).to have_content 'To do 4'
expect(page).to have_content 'Done 0'
expect(page).to have_content 'To do (4)'
expect(page).to have_content 'Done (0)'
expect(page).to have_link project.name_with_namespace
should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference}", merge_request.title)
......@@ -43,8 +43,8 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
end
page.within('.nav-sidebar') { expect(page).to have_content 'Todos 3' }
expect(page).to have_content 'To do 3'
expect(page).to have_content 'Done 1'
expect(page).to have_content 'To do (3)'
expect(page).to have_content 'Done (1)'
should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference}"
end
......
......@@ -344,12 +344,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step 'I should see a badge of "1" next to the discussion link' do
expect_discussion_badge_to_have_counter("1")
step 'I should see a badge of "(1)" next to the discussion link' do
expect_discussion_badge_to_have_counter("(1)")
end
step 'I should see a badge of "0" next to the discussion link' do
expect_discussion_badge_to_have_counter("0")
step 'I should see a badge of "(0)" next to the discussion link' do
expect_discussion_badge_to_have_counter("(0)")
end
step 'I should see a discussion has started on commit diff' do
......@@ -572,7 +572,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
def expect_discussion_badge_to_have_counter(value)
page.within(".notes-tab .badge") do
page.within(".notes-tab span") do
page.should have_content value
end
end
......
......@@ -151,7 +151,7 @@ describe 'Comments', feature: true do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
expect(merge_request.mr_and_commit_notes.count).to eq 2
expect(find('.notes-tab span.badge').text).to eq "1"
expect(find('.notes-tab span').text).to eq "(1)"
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment