summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-23 14:38:23 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-23 14:38:23 +0200
commit28e13634dc9318dbd093a4561ee8ea16e1d71460 (patch)
tree0a14694c45a8328fc9dbf868f310c5ba3a71184f /features
parent68590fddd860c5d840d8f04314ed11f0d02ddd44 (diff)
parent573f1f4ade80cc3b66723ad12594467e881b4510 (diff)
downloadgitlab-ce-28e13634dc9318dbd093a4561ee8ea16e1d71460.tar.gz
Merge branch 'improve/mr_diff'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: features/steps/project/project_fork.rb features/steps/project/project_forked_merge_requests.rb features/steps/project/project_issue_tracker.rb features/steps/project/project_markdown_render.rb features/steps/shared/project.rb
Diffstat (limited to 'features')
-rw-r--r--features/project/merge_requests.feature8
-rw-r--r--features/steps/dashboard/dashboard_issues.rb2
-rw-r--r--features/steps/dashboard/dashboard_merge_requests.rb2
-rw-r--r--features/steps/project/deploy_keys.rb2
-rw-r--r--features/steps/project/project_fork.rb4
-rw-r--r--features/steps/project/project_forked_merge_requests.rb4
-rw-r--r--features/steps/project/project_issue_tracker.rb2
-rw-r--r--features/steps/project/project_markdown_render.rb2
-rw-r--r--features/steps/project/project_merge_requests.rb51
-rw-r--r--features/steps/project/project_team_management.rb2
-rw-r--r--features/steps/project/redirects.rb2
-rw-r--r--features/steps/public/projects_feature.rb6
-rw-r--r--features/steps/shared/project.rb6
13 files changed, 51 insertions, 42 deletions
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature
index 4e4ac1a68e4..946f6760126 100644
--- a/features/project/merge_requests.feature
+++ b/features/project/merge_requests.feature
@@ -55,18 +55,18 @@ Feature: Project Merge Requests
Given project "Shop" have "Bug NS-05" open merge request with diffs inside
And I visit merge request page "Bug NS-05"
And I click on the first commit in the merge request
- And I leave a comment like "Line is wrong" on line 185 of the first file
+ And I leave a comment like "Line is wrong" on line 185 of the first file in commit
And I switch to the merge request's comments tab
- Then I should see a discussion has started on commit bcf03b5de6c:L185
+ Then I should see a discussion has started on commit b1e6a9dbf1:L185
@javascript
Scenario: I comment on a commit in merge request
Given project "Shop" have "Bug NS-05" open merge request with diffs inside
And I visit merge request page "Bug NS-05"
And I click on the first commit in the merge request
- And I leave a comment on the diff page
+ And I leave a comment on the diff page in commit
And I switch to the merge request's comments tab
- Then I should see a discussion has started on commit bcf03b5de6c
+ Then I should see a discussion has started on commit b1e6a9dbf1
@javascript
Scenario: I accept merge request with custom commit message
diff --git a/features/steps/dashboard/dashboard_issues.rb b/features/steps/dashboard/dashboard_issues.rb
index a458acdae07..1344edfa80b 100644
--- a/features/steps/dashboard/dashboard_issues.rb
+++ b/features/steps/dashboard/dashboard_issues.rb
@@ -66,7 +66,7 @@ class DashboardIssues < Spinach::FeatureSteps
def project
@project ||= begin
- project =create :project_with_code
+ project =create :project
project.team << [current_user, :master]
project
end
diff --git a/features/steps/dashboard/dashboard_merge_requests.rb b/features/steps/dashboard/dashboard_merge_requests.rb
index 73286532b93..62d84506c49 100644
--- a/features/steps/dashboard/dashboard_merge_requests.rb
+++ b/features/steps/dashboard/dashboard_merge_requests.rb
@@ -66,7 +66,7 @@ class DashboardMergeRequests < Spinach::FeatureSteps
def project
@project ||= begin
- project =create :project_with_code
+ project =create :project
project.team << [current_user, :master]
project
end
diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb
index 7f7492bfd6d..914da31322f 100644
--- a/features/steps/project/deploy_keys.rb
+++ b/features/steps/project/deploy_keys.rb
@@ -34,7 +34,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
step 'other project has deploy key' do
- @second_project = create :project, namespace: current_user.namespace
+ @second_project = create :project, namespace: create(:group)
@second_project.team << [current_user, :master]
create(:deploy_keys_project, project: @second_project)
end
diff --git a/features/steps/project/project_fork.rb b/features/steps/project/project_fork.rb
index 128687ca286..c00d9014b1d 100644
--- a/features/steps/project/project_fork.rb
+++ b/features/steps/project/project_fork.rb
@@ -12,7 +12,7 @@ class ForkProject < Spinach::FeatureSteps
step 'I am a member of project "Shop"' do
@project = Project.find_by(name: "Shop")
- @project ||= create(:project_with_code, name: "Shop", group: create(:group))
+ @project ||= create(:project, name: "Shop", group: create(:group))
@project.team << [@user, :reporter]
end
@@ -26,7 +26,7 @@ class ForkProject < Spinach::FeatureSteps
current_user.namespace ||= create(:namespace)
current_user.namespace.should_not be_nil
current_user.namespace.path.should_not be_nil
- @my_project = create(:project_with_code, name: "Shop", namespace: current_user.namespace)
+ @my_project = create(:project, name: "Shop", namespace: current_user.namespace)
end
step 'I should see a "Name has already been taken" warning' do
diff --git a/features/steps/project/project_forked_merge_requests.rb b/features/steps/project/project_forked_merge_requests.rb
index a8198532ae8..4cc99f8af55 100644
--- a/features/steps/project/project_forked_merge_requests.rb
+++ b/features/steps/project/project_forked_merge_requests.rb
@@ -7,7 +7,7 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
step 'I am a member of project "Shop"' do
@project = Project.find_by(name: "Shop")
- @project ||= create(:project_with_code, name: "Shop")
+ @project ||= create(:project, name: "Shop")
@project.team << [@user, :reporter]
end
@@ -15,7 +15,7 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
@forking_user = @user
forked_project_link = build(:forked_project_link)
@forked_project = Project.find_by(name: "Forked Shop")
- @forked_project ||= create(:source_project_with_code, name: "Forked Shop", forked_project_link: forked_project_link, creator_id: @forking_user.id , namespace: @forking_user.namespace)
+ @forked_project ||= create(:project, name: "Forked Shop", forked_project_link: forked_project_link, creator_id: @forking_user.id , namespace: @forking_user.namespace)
forked_project_link.forked_from_project = @project
forked_project_link.forked_to_project = @forked_project
diff --git a/features/steps/project/project_issue_tracker.rb b/features/steps/project/project_issue_tracker.rb
index fe41a900a90..c2fd4e15c9e 100644
--- a/features/steps/project/project_issue_tracker.rb
+++ b/features/steps/project/project_issue_tracker.rb
@@ -5,7 +5,7 @@ class ProjectIssueTracker < Spinach::FeatureSteps
step 'project "Shop" has issues enabled' do
@project = Project.find_by(name: "Shop")
- @project ||= create(:project_with_code, name: "Shop", namespace: @user.namespace)
+ @project ||= create(:project, name: "Shop", namespace: @user.namespace)
@project.issues_enabled = true
end
diff --git a/features/steps/project/project_markdown_render.rb b/features/steps/project/project_markdown_render.rb
index 3c5c3e09da9..0472cfef32d 100644
--- a/features/steps/project/project_markdown_render.rb
+++ b/features/steps/project/project_markdown_render.rb
@@ -4,7 +4,7 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
And 'I own project "Delta"' do
@project = Project.find_by(name: "Delta")
- @project ||= create(:project_with_code, name: "Delta", namespace: @user.namespace)
+ @project ||= create(:project, name: "Delta", namespace: @user.namespace)
@project.team << [@user, :master]
end
diff --git a/features/steps/project/project_merge_requests.rb b/features/steps/project/project_merge_requests.rb
index b771c8d1392..0c5f05a0a68 100644
--- a/features/steps/project/project_merge_requests.rb
+++ b/features/steps/project/project_merge_requests.rb
@@ -81,6 +81,8 @@ class ProjectMergeRequests < Spinach::FeatureSteps
title: "Bug NS-04",
source_project: project,
target_project: project,
+ source_branch: 'stable',
+ target_branch: 'master',
author: project.users.first)
end
@@ -109,33 +111,29 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I click on the first commit in the merge request' do
- click_link merge_request.commits.first.short_id(8)
+ within '.first-commits' do
+ click_link merge_request.commits.first.short_id(8)
+ end
end
step 'I leave a comment on the diff page' do
init_diff_note
+ leave_comment "One comment to rule them all"
+ end
- within('.js-discussion-note-form') do
- fill_in "note_note", with: "One comment to rule them all"
- click_button "Add Comment"
- end
-
- within ".note-text" do
- page.should have_content "One comment to rule them all"
- end
+ step 'I leave a comment on the diff page in commit' do
+ find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click
+ leave_comment "One comment to rule them all"
end
step 'I leave a comment like "Line is wrong" on line 185 of the first file' do
init_diff_note
+ leave_comment "Line is wrong"
+ end
- within(".js-discussion-note-form") do
- fill_in "note_note", with: "Line is wrong"
- click_button "Add Comment"
- end
-
- within ".note-text" do
- page.should have_content "Line is wrong"
- end
+ step 'I leave a comment like "Line is wrong" on line 185 of the first file in commit' do
+ find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click
+ leave_comment "Line is wrong"
end
step 'I should see a discussion has started on line 185' do
@@ -144,14 +142,14 @@ class ProjectMergeRequests < Spinach::FeatureSteps
page.should have_content "Line is wrong"
end
- step 'I should see a discussion has started on commit bcf03b5de6c:L185' do
+ step 'I should see a discussion has started on commit b1e6a9dbf1:L185' do
page.should have_content "#{current_user.name} started a discussion on commit"
page.should have_content "app/assets/stylesheets/tree.scss:L185"
page.should have_content "Line is wrong"
end
- step 'I should see a discussion has started on commit bcf03b5de6c' do
- page.should have_content "#{current_user.name} started a discussion on commit bcf03b5de6c"
+ step 'I should see a discussion has started on commit b1e6a9dbf1' do
+ page.should have_content "#{current_user.name} started a discussion on commit"
page.should have_content "One comment to rule them all"
page.should have_content "app/assets/stylesheets/tree.scss:L185"
end
@@ -188,6 +186,17 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
def init_diff_note
- find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click
+ find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
+ end
+
+ def leave_comment(message)
+ within(".js-discussion-note-form") do
+ fill_in "note_note", with: message
+ click_button "Add Comment"
+ end
+
+ within ".note-text" do
+ page.should have_content message
+ end
end
end
diff --git a/features/steps/project/project_team_management.rb b/features/steps/project/project_team_management.rb
index cde06cadda3..ffc5016529f 100644
--- a/features/steps/project/project_team_management.rb
+++ b/features/steps/project/project_team_management.rb
@@ -79,7 +79,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps
end
Given 'I own project "Website"' do
- @project = create(:project, name: "Website", namespace: @user.namespace)
+ @project = create(:empty_project, name: "Website", namespace: @user.namespace)
@project.team << [@user, :master]
end
diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb
index 896f7180f95..76ffea1bb6f 100644
--- a/features/steps/project/redirects.rb
+++ b/features/steps/project/redirects.rb
@@ -4,7 +4,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
include SharedProject
step 'public project "Community"' do
- create :project_with_code, name: 'Community', visibility_level: Gitlab::VisibilityLevel::PUBLIC
+ create :project, name: 'Community', visibility_level: Gitlab::VisibilityLevel::PUBLIC
end
step 'private project "Enterprise"' do
diff --git a/features/steps/public/projects_feature.rb b/features/steps/public/projects_feature.rb
index 49db9b316be..c3ec10b87d3 100644
--- a/features/steps/public/projects_feature.rb
+++ b/features/steps/public/projects_feature.rb
@@ -25,11 +25,11 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
end
step 'public project "Community"' do
- create :project_with_code, name: 'Community', visibility_level: Gitlab::VisibilityLevel::PUBLIC
+ create :project, name: 'Community', visibility_level: Gitlab::VisibilityLevel::PUBLIC
end
step 'public empty project "Empty Public Project"' do
- create :project, name: 'Empty Public Project', visibility_level: Gitlab::VisibilityLevel::PUBLIC
+ create :empty_project, name: 'Empty Public Project', visibility_level: Gitlab::VisibilityLevel::PUBLIC
end
step 'I visit empty project page' do
@@ -76,7 +76,7 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
end
step 'internal project "Internal"' do
- create :project_with_code, name: 'Internal', visibility_level: Gitlab::VisibilityLevel::INTERNAL
+ create :project, name: 'Internal', visibility_level: Gitlab::VisibilityLevel::INTERNAL
end
step 'I should see project "Internal"' do
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index 00c289c2329..7360482d736 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -3,21 +3,21 @@ module SharedProject
# Create a project without caring about what it's called
And "I own a project" do
- @project = create(:project_with_code, namespace: @user.namespace)
+ @project = create(:project, namespace: @user.namespace)
@project.team << [@user, :master]
end
# Create a specific project called "Shop"
And 'I own project "Shop"' do
@project = Project.find_by(name: "Shop")
- @project ||= create(:project_with_code, name: "Shop", namespace: @user.namespace)
+ @project ||= create(:project, name: "Shop", namespace: @user.namespace)
@project.team << [@user, :master]
end
# Create another specific project called "Forum"
And 'I own project "Forum"' do
@project = Project.find_by(name: "Forum")
- @project ||= create(:project_with_code, name: "Forum", namespace: @user.namespace, path: 'forum_project')
+ @project ||= create(:project, name: "Forum", namespace: @user.namespace, path: 'forum_project')
@project.team << [@user, :master]
end