summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
Diffstat (limited to 'features')
-rw-r--r--features/admin/users.feature6
-rw-r--r--features/group.feature3
-rw-r--r--features/project/commits/branches.feature12
-rw-r--r--features/project/forked_merge_requests.feature6
-rw-r--r--features/project/merge_requests.feature7
-rw-r--r--features/project/source/markdown_render.feature38
-rw-r--r--features/public/public_groups.feature118
-rw-r--r--features/steps/admin/users.rb13
-rw-r--r--features/steps/project/browse_branches.rb28
-rw-r--r--features/steps/project/forked_merge_requests.rb10
-rw-r--r--features/steps/project/markdown_render.rb75
-rw-r--r--features/steps/project/merge_requests.rb12
-rw-r--r--features/steps/public/groups_feature.rb93
-rw-r--r--features/steps/shared/diff_note.rb42
14 files changed, 412 insertions, 51 deletions
diff --git a/features/admin/users.feature b/features/admin/users.feature
index 7f503cf9235..ce9f32f50d9 100644
--- a/features/admin/users.feature
+++ b/features/admin/users.feature
@@ -14,3 +14,9 @@ Feature: Admin Users
And Click save
Then See username error message
And Not changed form action url
+
+ Scenario: Edit my user attributes
+ Given I visit admin users page
+ And click edit on my user
+ When I submit modified user
+ Then I see user attributes changed
diff --git a/features/group.feature b/features/group.feature
index aa49056fee2..4e11bcba939 100644
--- a/features/group.feature
+++ b/features/group.feature
@@ -74,7 +74,7 @@ Feature: Groups
When I visit group "Owned" members page
Then I should see user "John Doe" in team list
Then I should see user "Mary Jane" in team list
- Then I should not see the "Remove User From Group" button for "Mary Jane"
+ Then I should not see the "Remove User From Group" button for "John Doe"
@javascript
Scenario: Guest should be able to remove himself from group
@@ -97,7 +97,6 @@ Feature: Groups
# Remove others
- @javascript
Scenario: Owner should be able to remove other users from group
Given "Mary Jane" is owner of group "Owned"
When I visit group "Owned" members page
diff --git a/features/project/commits/branches.feature b/features/project/commits/branches.feature
index 4fa4dc26a1b..fcf8b7694f4 100644
--- a/features/project/commits/branches.feature
+++ b/features/project/commits/branches.feature
@@ -16,11 +16,7 @@ Feature: Project Browse branches
Given I click link "Protected"
Then I should see "Shop" protected branches list
- # @wip
- # Scenario: I can download project by branch
-
- # @wip
- # Scenario: I can view protected branches
-
- # @wip
- # Scenario: I can manage protected branches
+ Scenario: I create a branch
+ Given I click new branch link
+ When I submit new branch form
+ Then I should see new branch created
diff --git a/features/project/forked_merge_requests.feature b/features/project/forked_merge_requests.feature
index 966905645a2..2d94b98c90b 100644
--- a/features/project/forked_merge_requests.feature
+++ b/features/project/forked_merge_requests.feature
@@ -32,3 +32,9 @@ Feature: Project Forked Merge Requests
And I fill out an invalid "Merge Request On Forked Project" merge request
And I submit the merge request
Then I should see validation errors
+
+ @javascript
+ Scenario: Merge request should target fork repository by default
+ Given I visit project "Forked Shop" merge requests page
+ And I click link "New Merge Request"
+ Then the target repository should be the original repository \ No newline at end of file
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature
index 556b96338d6..435c47a276c 100644
--- a/features/project/merge_requests.feature
+++ b/features/project/merge_requests.feature
@@ -29,6 +29,13 @@ Feature: Project Merge Requests
And I click link "Close"
Then I should see closed merge request "Bug NS-04"
+ Scenario: I reopen merge request page
+ Given I click link "Bug NS-04"
+ And I click link "Close"
+ Then I should see closed merge request "Bug NS-04"
+ When I click link "Reopen"
+ Then I should see reopened merge request "Bug NS-04"
+
Scenario: I submit new unassigned merge request
Given I click link "New Merge Request"
And I submit new merge request "Wiki Feature"
diff --git a/features/project/source/markdown_render.feature b/features/project/source/markdown_render.feature
index 42d6ebcb1cf..970a9e57864 100644
--- a/features/project/source/markdown_render.feature
+++ b/features/project/source/markdown_render.feature
@@ -4,9 +4,7 @@ Feature: Project markdown render
And I own project "Delta"
Given I visit project source page
- # -------------------------------------------
- # README
- # -------------------------------------------
+ # Tree README
Scenario: Tree view should have correct links in README
Given I go directory which contains README file
@@ -41,9 +39,7 @@ Feature: Project markdown render
Then I should see rendered README which contains correct links
And Header "Application details" should have correct id and link
- # -------------------------------------------
- # File content
- # -------------------------------------------
+ # Blob
Scenario: I navigate to doc directory to view documentation in master
And I navigate to the doc/api/README
@@ -61,9 +57,7 @@ Feature: Project markdown render
And I navigate to the doc/api/README
And Header "GitLab API" should have correct id and link
- # -------------------------------------------
- # Markdown branch README
- # -------------------------------------------
+ # Markdown branch
Scenario: I browse files from markdown branch
When I visit markdown branch
@@ -93,9 +87,31 @@ Feature: Project markdown render
And I click on raketasks in doc/api/README
Then I should see correct directory rendered for markdown branch
- # -------------------------------------------
+ Scenario: Tree markdown links view empty urls should have correct urls
+ When I visit markdown branch
+ Then The link with text "empty" should have url "tree/markdown"
+ When I visit markdown branch "README.md" blob
+ Then The link with text "empty" should have url "blob/markdown/README.md"
+ When I visit markdown branch "d" tree
+ Then The link with text "empty" should have url "tree/markdown/d"
+ When I visit markdown branch "d/README.md" blob
+ Then The link with text "empty" should have url "blob/markdown/d/README.md"
+
+ # "ID" means "#id" on the tests below, because we are unable to escape the hash sign.
+ # which Spinach interprets as the start of a comment.
+ Scenario: All markdown links with ids should have correct urls
+ When I visit markdown branch
+ Then The link with text "ID" should have url "tree/markdownID"
+ Then The link with text "/ID" should have url "tree/markdownID"
+ Then The link with text "README.mdID" should have url "blob/markdown/README.mdID"
+ Then The link with text "d/README.mdID" should have url "blob/markdown/d/README.mdID"
+ When I visit markdown branch "README.md" blob
+ Then The link with text "ID" should have url "blob/markdown/README.mdID"
+ Then The link with text "/ID" should have url "blob/markdown/README.mdID"
+ Then The link with text "README.mdID" should have url "blob/markdown/README.mdID"
+ Then The link with text "d/README.mdID" should have url "blob/markdown/d/README.mdID"
+
# Wiki
- # -------------------------------------------
Scenario: I create a wiki page with different links
Given I go to wiki page
diff --git a/features/public/public_groups.feature b/features/public/public_groups.feature
new file mode 100644
index 00000000000..7f1ec718e35
--- /dev/null
+++ b/features/public/public_groups.feature
@@ -0,0 +1,118 @@
+Feature: Public Projects Feature
+ Background:
+ Given group "TestGroup" has private project "Enterprise"
+
+ Scenario: I should not see group with private projects as visitor
+ When I visit group "TestGroup" page
+ Then I should be redirected to sign in page
+
+ Scenario: I should not see group with private projects group as user
+ When I sign in as a user
+ And I visit group "TestGroup" page
+ Then page status code should be 404
+
+ Scenario: I should not see group with private and internal projects as visitor
+ Given group "TestGroup" has internal project "Internal"
+ When I visit group "TestGroup" page
+ Then I should be redirected to sign in page
+
+ Scenario: I should see group with private and internal projects as user
+ Given group "TestGroup" has internal project "Internal"
+ When I sign in as a user
+ And I visit group "TestGroup" page
+ Then I should see project "Internal" items
+ And I should not see project "Enterprise" items
+
+ Scenario: I should see group issues for internal project as user
+ Given group "TestGroup" has internal project "Internal"
+ When I sign in as a user
+ And I visit group "TestGroup" issues page
+ And I change filter to Everyone's
+ Then I should see project "Internal" items
+ And I should not see project "Enterprise" items
+
+ Scenario: I should see group merge requests for internal project as user
+ Given group "TestGroup" has internal project "Internal"
+ When I sign in as a user
+ And I visit group "TestGroup" merge requests page
+ And I change filter to Everyone's
+ Then I should see project "Internal" items
+ And I should not see project "Enterprise" items
+
+ Scenario: I should see group's members as user
+ Given group "TestGroup" has internal project "Internal"
+ And "John Doe" is owner of group "TestGroup"
+ When I sign in as a user
+ And I visit group "TestGroup" members page
+ Then I should see group member "John Doe"
+ And I should not see member roles
+
+ Scenario: I should see group with private, internal and public projects as visitor
+ Given group "TestGroup" has internal project "Internal"
+ Given group "TestGroup" has public project "Community"
+ When I visit group "TestGroup" page
+ Then I should see project "Community" items
+ And I should not see project "Internal" items
+ And I should not see project "Enterprise" items
+
+ Scenario: I should see group issues for public project as visitor
+ Given group "TestGroup" has internal project "Internal"
+ Given group "TestGroup" has public project "Community"
+ When I visit group "TestGroup" issues page
+ Then I should see project "Community" items
+ And I should not see project "Internal" items
+ And I should not see project "Enterprise" items
+
+ Scenario: I should see group merge requests for public project as visitor
+ Given group "TestGroup" has internal project "Internal"
+ Given group "TestGroup" has public project "Community"
+ When I visit group "TestGroup" merge requests page
+ Then I should see project "Community" items
+ And I should not see project "Internal" items
+ And I should not see project "Enterprise" items
+
+ Scenario: I should see group's members as visitor
+ Given group "TestGroup" has internal project "Internal"
+ Given group "TestGroup" has public project "Community"
+ And "John Doe" is owner of group "TestGroup"
+ When I visit group "TestGroup" members page
+ Then I should see group member "John Doe"
+ And I should not see member roles
+
+ Scenario: I should see group with private, internal and public projects as user
+ Given group "TestGroup" has internal project "Internal"
+ Given group "TestGroup" has public project "Community"
+ When I sign in as a user
+ And I visit group "TestGroup" page
+ Then I should see project "Community" items
+ And I should see project "Internal" items
+ And I should not see project "Enterprise" items
+
+ Scenario: I should see group issues for internal and public projects as user
+ Given group "TestGroup" has internal project "Internal"
+ Given group "TestGroup" has public project "Community"
+ When I sign in as a user
+ And I visit group "TestGroup" issues page
+ And I change filter to Everyone's
+ Then I should see project "Community" items
+ And I should see project "Internal" items
+ And I should not see project "Enterprise" items
+
+ Scenario: I should see group merge requests for internal and public projects as user
+ Given group "TestGroup" has internal project "Internal"
+ Given group "TestGroup" has public project "Community"
+ When I sign in as a user
+ And I visit group "TestGroup" merge requests page
+ And I change filter to Everyone's
+ Then I should see project "Community" items
+ And I should see project "Internal" items
+ And I should not see project "Enterprise" items
+
+ Scenario: I should see group's members as user
+ Given group "TestGroup" has internal project "Internal"
+ Given group "TestGroup" has public project "Community"
+ And "John Doe" is owner of group "TestGroup"
+ When I sign in as a user
+ And I visit group "TestGroup" members page
+ Then I should see group member "John Doe"
+ And I should not see member roles
diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb
index 33c1344eaeb..659008dd875 100644
--- a/features/steps/admin/users.rb
+++ b/features/steps/admin/users.rb
@@ -31,4 +31,17 @@ class AdminUsers < Spinach::FeatureSteps
And 'Not changed form action url' do
page.should have_selector %(form[action="/admin/users/#{@user.username}"])
end
+
+ step 'I submit modified user' do
+ check :user_can_create_group
+ click_button 'Save'
+ end
+
+ step 'I see user attributes changed' do
+ page.should have_content 'Can create groups: Yes'
+ end
+
+ step 'click edit on my user' do
+ find("#edit_user_#{current_user.id}").click
+ end
end
diff --git a/features/steps/project/browse_branches.rb b/features/steps/project/browse_branches.rb
index ef29cc67a4e..30c8cef80c8 100644
--- a/features/steps/project/browse_branches.rb
+++ b/features/steps/project/browse_branches.rb
@@ -3,33 +3,49 @@ class ProjectBrowseBranches < Spinach::FeatureSteps
include SharedProject
include SharedPaths
- Then 'I should see "Shop" recent branches list' do
+ step 'I should see "Shop" recent branches list' do
page.should have_content "Branches"
page.should have_content "master"
end
- Given 'I click link "All"' do
+ step 'I click link "All"' do
click_link "All"
end
- Then 'I should see "Shop" all branches list' do
+ step 'I should see "Shop" all branches list' do
page.should have_content "Branches"
page.should have_content "master"
end
- Given 'I click link "Protected"' do
+ step 'I click link "Protected"' do
click_link "Protected"
end
- Then 'I should see "Shop" protected branches list' do
+ step 'I should see "Shop" protected branches list' do
within ".protected-branches-list" do
page.should have_content "stable"
page.should_not have_content "master"
end
end
- And 'project "Shop" has protected branches' do
+ step 'project "Shop" has protected branches' do
project = Project.find_by(name: "Shop")
project.protected_branches.create(name: "stable")
end
+
+ step 'I click new branch link' do
+ click_link "New branch"
+ end
+
+ step 'I submit new branch form' do
+ fill_in 'branch_name', with: 'deploy_keys'
+ fill_in 'ref', with: 'master'
+ click_button 'Create branch'
+ end
+
+ step 'I should see new branch created' do
+ within '.all-branches' do
+ page.should have_content 'deploy_keys'
+ end
+ end
end
diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb
index 4cc99f8af55..df69cb75437 100644
--- a/features/steps/project/forked_merge_requests.rb
+++ b/features/steps/project/forked_merge_requests.rb
@@ -159,8 +159,11 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
step 'I fill out an invalid "Merge Request On Forked Project" merge request' do
#If this isn't filled in the rest of the validations won't be triggered
fill_in "merge_request_title", with: "Merge Request On Forked Project"
+
+ select "Select branch", from: "merge_request_target_branch"
+
find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s
- find(:select, "merge_request_target_project_id", {}).value.should == @forked_project.id.to_s
+ find(:select, "merge_request_target_project_id", {}).value.should == project.id.to_s
find(:select, "merge_request_source_branch", {}).value.should == ""
find(:select, "merge_request_target_branch", {}).value.should == ""
end
@@ -168,7 +171,10 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
step 'I should see validation errors' do
page.should have_content "Source branch can't be blank"
page.should have_content "Target branch can't be blank"
- page.should have_content "Branch conflict You can not use same project/branch for source and target"
+ end
+
+ step 'the target repository should be the original repository' do
+ page.should have_select("merge_request_target_project_id", selected: project.path_with_namespace)
end
def project
diff --git a/features/steps/project/markdown_render.rb b/features/steps/project/markdown_render.rb
index 89fbb7408c2..8fbf2753aa7 100644
--- a/features/steps/project/markdown_render.rb
+++ b/features/steps/project/markdown_render.rb
@@ -1,3 +1,6 @@
+# If you need to modify the existing seed repository for your tests,
+# it is recommended that you make the changes on the `markdown` branch of the seed project repository,
+# which should only be used by tests in this file. See `/spec/factories.rb#project` for more info.
class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
@@ -50,7 +53,7 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
end
Then 'I should see correct doc/api directory rendered' do
- current_path.should == project_tree_path(@project, "master/doc/api/")
+ current_path.should == project_tree_path(@project, "master/doc/api")
page.should have_content "README.md"
page.should have_content "users.md"
end
@@ -64,6 +67,18 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production"
end
+ And 'I click on link "empty" in the README' do
+ within('.readme-holder') do
+ click_link "empty"
+ end
+ end
+
+ And 'I click on link "id" in the README' do
+ within('.readme-holder') do
+ click_link "#id"
+ end
+ end
+
And 'I navigate to the doc/api/README' do
click_link "doc"
click_link "api"
@@ -90,10 +105,24 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
click_link "Rake tasks"
end
+ # Markdown branch
+
When 'I visit markdown branch' do
visit project_tree_path(@project, "markdown")
end
+ When 'I visit markdown branch "README.md" blob' do
+ visit project_blob_path(@project, "markdown/README.md")
+ end
+
+ When 'I visit markdown branch "d" tree' do
+ visit project_tree_path(@project, "markdown/d")
+ end
+
+ When 'I visit markdown branch "d/README.md" blob' do
+ visit project_blob_path(@project, "markdown/d/README.md")
+ end
+
Then 'I should see files from repository in markdown branch' do
current_path.should == project_tree_path(@project, "markdown")
page.should have_content "Gemfile"
@@ -124,6 +153,50 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
page.should have_content "Get a list of users."
end
+ # Expected link contents
+
+ Then 'The link with text "empty" should have url "tree/markdown"' do
+ find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown")
+ end
+
+ Then 'The link with text "empty" should have url "blob/markdown/README.md"' do
+ find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md")
+ end
+
+ Then 'The link with text "empty" should have url "tree/markdown/d"' do
+ find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown/d")
+ end
+
+ Then 'The link with text "empty" should have url "blob/markdown/d/README.md"' do
+ find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/d/README.md")
+ end
+
+ Then 'The link with text "ID" should have url "tree/markdownID"' do
+ find('a', text: /^#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id'
+ end
+
+ Then 'The link with text "/ID" should have url "tree/markdownID"' do
+ find('a', text: /^\/#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id'
+ end
+
+ Then 'The link with text "README.mdID" should have url "blob/markdown/README.mdID"' do
+ find('a', text: /^README.md#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id'
+ end
+
+ Then 'The link with text "d/README.mdID" should have url "blob/markdown/d/README.mdID"' do
+ find('a', text: /^d\/README.md#id$/)['href'] == current_host + project_blob_path(@project, "d/markdown/README.md") + '#id'
+ end
+
+ Then 'The link with text "ID" should have url "blob/markdown/README.mdID"' do
+ find('a', text: /^#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id'
+ end
+
+ Then 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do
+ find('a', text: /^\/#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id'
+ end
+
+ # Wiki
+
Given 'I go to wiki page' do
click_link "Wiki"
current_path.should == project_wiki_path(@project, "home")
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index adf9e77e136..813e7439b2c 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -170,6 +170,18 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
end
+ step 'I click link "Reopen"' do
+ within '.page-title' do
+ click_link "Reopen"
+ end
+ end
+
+ step 'I should see reopened merge request "Bug NS-04"' do
+ within '.state-label' do
+ page.should have_content "Open"
+ end
+ end
+
def project
@project ||= Project.find_by!(name: "Shop")
end
diff --git a/features/steps/public/groups_feature.rb b/features/steps/public/groups_feature.rb
new file mode 100644
index 00000000000..015deca5427
--- /dev/null
+++ b/features/steps/public/groups_feature.rb
@@ -0,0 +1,93 @@
+class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedGroup
+ include SharedProject
+
+ step 'group "TestGroup" has private project "Enterprise"' do
+ group_has_project("TestGroup", "Enterprise", Gitlab::VisibilityLevel::PRIVATE)
+ end
+
+ step 'group "TestGroup" has internal project "Internal"' do
+ group_has_project("TestGroup", "Internal", Gitlab::VisibilityLevel::INTERNAL)
+ end
+
+ step 'group "TestGroup" has public project "Community"' do
+ group_has_project("TestGroup", "Community", Gitlab::VisibilityLevel::PUBLIC)
+ end
+
+ step '"John Doe" is owner of group "TestGroup"' do
+ group = Group.find_by(name: "TestGroup") || create(:group, name: "TestGroup")
+ user = create(:user, name: "John Doe")
+ group.add_user(user, Gitlab::Access::OWNER)
+ end
+
+ step 'I visit group "TestGroup" page' do
+ visit group_path(Group.find_by(name: "TestGroup"))
+ end
+
+ step 'I visit group "TestGroup" issues page' do
+ visit issues_group_path(Group.find_by(name: "TestGroup"))
+ end
+
+ step 'I visit group "TestGroup" merge requests page' do
+ visit merge_requests_group_path(Group.find_by(name: "TestGroup"))
+ end
+
+ step 'I visit group "TestGroup" members page' do
+ visit members_group_path(Group.find_by(name: "TestGroup"))
+ end
+
+ step 'I should not see project "Enterprise" items' do
+ page.should_not have_content "Enterprise"
+ end
+
+ step 'I should see project "Internal" items' do
+ page.should have_content "Internal"
+ end
+
+ step 'I should not see project "Internal" items' do
+ page.should_not have_content "Internal"
+ end
+
+ step 'I should see project "Community" items' do
+ page.should have_content "Community"
+ end
+
+ step 'I change filter to Everyone\'s' do
+ click_link "Everyone's"
+ end
+
+ step 'I should see group member "John Doe"' do
+ page.should have_content "John Doe"
+ end
+
+ step 'I should not see member roles' do
+ page.body.should_not match(%r{owner|developer|reporter|guest}i)
+ end
+
+ protected
+
+ def group_has_project(groupname, projectname, visibility_level)
+ group = Group.find_by(name: groupname) || create(:group, name: groupname)
+ project = create(:project,
+ namespace: group,
+ name: projectname,
+ path: "#{groupname}-#{projectname}",
+ visibility_level: visibility_level
+ )
+ create(:issue,
+ title: "#{projectname} feature",
+ project: project
+ )
+ create(:merge_request,
+ title: "#{projectname} feature implemented",
+ source_project: project,
+ target_project: project
+ )
+ create(:closed_issue_event,
+ project: project
+ )
+ end
+end
+
diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb
index 9c39a226e1b..f80d8d06475 100644
--- a/features/steps/shared/diff_note.rb
+++ b/features/steps/shared/diff_note.rb
@@ -2,7 +2,7 @@ module SharedDiffNote
include Spinach::DSL
Given 'I cancel the diff comment' do
- within(".file") do
+ within(".diff-file") do
find(".js-close-discussion-note-form").click
end
end
@@ -13,14 +13,14 @@ module SharedDiffNote
end
Given 'I haven\'t written any diff comment text' do
- within(".file") do
+ within(".diff-file") do
fill_in "note[note]", with: ""
end
end
Given 'I leave a diff comment like "Typo, please fix"' do
find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_29_14"]').click
- within(".file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do
+ within(".diff-file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do
fill_in "note[note]", with: "Typo, please fix"
find(".js-comment-button").trigger("click")
sleep 0.05
@@ -29,7 +29,7 @@ module SharedDiffNote
Given 'I preview a diff comment text like "Should fix it :smile:"' do
find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_29_14"]').click
- within(".file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do
+ within(".diff-file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']") do
fill_in "note[note]", with: "Should fix it :smile:"
find(".js-note-preview-button").trigger("click")
end
@@ -38,7 +38,7 @@ module SharedDiffNote
Given 'I preview another diff comment text like "DRY this up"' do
find('a[data-line-code="586fb7c4e1add2d4d24e27566ed7064680098646_57_41"]').click
- within(".file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_57_41']") do
+ within(".diff-file form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_57_41']") do
fill_in "note[note]", with: "DRY this up"
find(".js-note-preview-button").trigger("click")
end
@@ -53,13 +53,13 @@ module SharedDiffNote
end
Given 'I write a diff comment like ":-1: I don\'t like this"' do
- within(".file") do
+ within(".diff-file") do
fill_in "note[note]", with: ":-1: I don\'t like this"
end
end
Given 'I submit the diff comment' do
- within(".file") do
+ within(".diff-file") do
click_button("Add Comment")
end
end
@@ -67,49 +67,49 @@ module SharedDiffNote
Then 'I should not see the diff comment form' do
- within(".file") do
+ within(".diff-file") do
page.should_not have_css("form.new_note")
end
end
Then 'I should not see the diff comment preview button' do
- within(".file") do
+ within(".diff-file") do
page.should have_css(".js-note-preview-button", visible: false)
end
end
Then 'I should not see the diff comment text field' do
- within(".file") do
+ within(".diff-file") do
page.should have_css(".js-note-text", visible: false)
end
end
Then 'I should only see one diff form' do
- within(".file") do
+ within(".diff-file") do
page.should have_css("form.new_note", count: 1)
end
end
Then 'I should see a diff comment form with ":-1: I don\'t like this"' do
- within(".file") do
+ within(".diff-file") do
page.should have_field("note[note]", with: ":-1: I don\'t like this")
end
end
Then 'I should see a diff comment saying "Typo, please fix"' do
- within(".file .note") do
+ within(".diff-file .note") do
page.should have_content("Typo, please fix")
end
end
Then 'I should see a discussion reply button' do
- within(".file") do
+ within(".diff-file") do
page.should have_link("Reply")
end
end
Then 'I should see a temporary diff comment form' do
- within(".file") do
+ within(".diff-file") do
page.should have_css(".js-temp-notes-holder form.new_note")
end
end
@@ -119,37 +119,37 @@ module SharedDiffNote
end
Then 'I should see an empty diff comment form' do
- within(".file") do
+ within(".diff-file") do
page.should have_field("note[note]", with: "")
end
end
Then 'I should see the cancel comment button' do
- within(".file form") do
+ within(".diff-file form") do
page.should have_css(".js-close-discussion-note-form", text: "Cancel")
end
end
Then 'I should see the diff comment preview' do
- within(".file form") do
+ within(".diff-file form") do
page.should have_css(".js-note-preview", visible: false)
end
end
Then 'I should see the diff comment edit button' do
- within(".file") do
+ within(".diff-file") do
page.should have_css(".js-note-edit-button", visible: true)
end
end
Then 'I should see the diff comment preview button' do
- within(".file") do
+ within(".diff-file") do
page.should have_css(".js-note-preview-button", visible: true)
end
end
Then 'I should see two separate previews' do
- within(".file") do
+ within(".diff-file") do
page.should have_css(".js-note-preview", visible: true, count: 2)
page.should have_content("Should fix it")
page.should have_content("DRY this up")