summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--features/dashboard/dashboard.feature2
-rw-r--r--features/profile/profile.feature6
-rw-r--r--features/projects/commits/branches.feature12
-rw-r--r--features/projects/commits/commit_comments.feature5
-rw-r--r--features/projects/commits/tags.feature3
-rw-r--r--features/projects/issues/issues.feature30
-rw-r--r--features/projects/issues/milestones.feature18
-rw-r--r--features/projects/project.feature11
-rw-r--r--features/projects/source/browse_files.feature (renamed from features/projects/source/browse_files.feature.commented)0
-rw-r--r--features/projects/source/git_blame.feature10
-rw-r--r--features/projects/wiki.feature6
-rw-r--r--features/step_definitions/profile/profile_keys_steps.rb (renamed from features/step_definitions/profile_keys_steps.rb)0
-rw-r--r--features/step_definitions/profile/profile_steps.rb (renamed from features/step_definitions/profile_steps.rb)13
-rw-r--r--features/step_definitions/project/browse_code_steps.rb (renamed from features/step_definitions/browse_code_steps.rb)10
-rw-r--r--features/step_definitions/project/project_commits_steps.rb (renamed from features/step_definitions/project_commits_steps.rb)27
-rw-r--r--features/step_definitions/project/project_issues_steps.rb (renamed from features/step_definitions/project_issues_steps.rb)20
-rw-r--r--features/step_definitions/project/project_merge_requests_steps.rb38
-rw-r--r--features/step_definitions/project/project_team_steps.rb (renamed from features/step_definitions/project_team_steps.rb)0
-rw-r--r--features/step_definitions/project/project_wiki_steps.rb (renamed from features/step_definitions/project_wiki_steps.rb)0
-rw-r--r--features/step_definitions/project/projects_steps.rb (renamed from features/step_definitions/projects_steps.rb)14
-rw-r--r--spec/monkeypatch.rb6
-rw-r--r--spec/requests/atom/dashboard_issues_spec.rb (renamed from spec/requests/dashboard_issues_spec.rb)8
-rw-r--r--spec/requests/atom/dashboard_spec.rb (renamed from spec/requests/dashboard_spec.rb)12
-rw-r--r--spec/requests/atom/issues_spec.rb40
-rw-r--r--spec/requests/commits_notes_spec.rb28
-rw-r--r--spec/requests/commits_spec.rb68
-rw-r--r--spec/requests/dashboard_merge_requests_spec.rb40
-rw-r--r--spec/requests/file_blame_spec.rb25
-rw-r--r--spec/requests/issues_notes_spec.rb27
-rw-r--r--spec/requests/issues_spec.rb155
-rw-r--r--spec/requests/keys_spec.rb65
-rw-r--r--spec/requests/last_push_widget_spec.rb52
-rw-r--r--spec/requests/milestones_spec.rb51
-rw-r--r--spec/requests/profile_spec.rb82
-rw-r--r--spec/requests/projects_spec.rb77
-rw-r--r--spec/requests/projects_tree_spec.rb90
-rw-r--r--spec/requests/projects_wall_spec.rb33
-rw-r--r--spec/requests/repositories_spec.rb49
-rw-r--r--spec/requests/security/profile_access_spec.rb (renamed from spec/requests/user_security_spec.rb)3
-rw-r--r--spec/requests/security/project_access_spec.rb (renamed from spec/requests/projects_security_spec.rb)2
-rw-r--r--spec/requests/team_members_spec.rb68
-rw-r--r--spec/requests/wikis_notes_spec.rb29
-rw-r--r--spec/requests/wikis_spec.rb35
43 files changed, 261 insertions, 1009 deletions
diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature
index 2d66af53b7b..a8c2205c143 100644
--- a/features/dashboard/dashboard.feature
+++ b/features/dashboard/dashboard.feature
@@ -10,7 +10,7 @@ Feature: Dashboard
Then I should see "Shop" project link
Then I should see project "Shop" activity feed
- Scenario: I should see last pish widget
+ Scenario: I should see last push widget
Then I should see last push widget
And I click "Create Merge Request" link
Then I see prefilled new Merge Request page
diff --git a/features/profile/profile.feature b/features/profile/profile.feature
index e3d71abc746..afda4b55081 100644
--- a/features/profile/profile.feature
+++ b/features/profile/profile.feature
@@ -6,6 +6,11 @@ Feature: Profile
Given I visit profile page
Then I should see my profile info
+ Scenario: I edit profile
+ Given I visit profile page
+ Then I change my contact info
+ And I should see new contact info
+
Scenario: I change my password
Given I visit profile password page
Then I change my password
@@ -15,4 +20,3 @@ Feature: Profile
Given I visit profile token page
Then I reset my token
And I should see new token
-
diff --git a/features/projects/commits/branches.feature b/features/projects/commits/branches.feature
index 2b136e1b582..74575c51c5a 100644
--- a/features/projects/commits/branches.feature
+++ b/features/projects/commits/branches.feature
@@ -2,9 +2,19 @@ Feature: Browse branches
Background:
Given I signin as a user
And I own project "Shop"
+ And project "Shop" has protected branches
Given I visit project branches page
- Scenario: I can see all git branches
+ Scenario: I can see project recent git branches
+ Then I should see "Shop" recent branches list
+
+ Scenario: I can see project all git branches
+ Given I click link "All"
+ Then I should see "Shop" all branches list
+
+ Scenario: I can see project protected git branches
+ Given I click link "Protected"
+ Then I should see "Shop" protected branches list
Scenario: I can download project by branch
diff --git a/features/projects/commits/commit_comments.feature b/features/projects/commits/commit_comments.feature
index bdf47b88fc3..9bd56d29f1e 100644
--- a/features/projects/commits/commit_comments.feature
+++ b/features/projects/commits/commit_comments.feature
@@ -4,4 +4,7 @@ Feature: Comment commit
And I own project "Shop"
Given I visit project commit page
- Scenario: I leave a comment for commit
+ @javascript
+ Scenario: I comment commit
+ Given I leave a comment like "XML attached"
+ Then I should see comment "XML attached"
diff --git a/features/projects/commits/tags.feature b/features/projects/commits/tags.feature
index 81221748500..f7899fc3ce0 100644
--- a/features/projects/commits/tags.feature
+++ b/features/projects/commits/tags.feature
@@ -5,7 +5,6 @@ Feature: Browse tags
Given I visit project tags page
Scenario: I can see all git tags
+ Then I should see "Shop" all tags list
Scenario: I can download project by tag
-
-
diff --git a/features/projects/issues/issues.feature b/features/projects/issues/issues.feature
index 0ca0792dd8a..180710cf6bc 100644
--- a/features/projects/issues/issues.feature
+++ b/features/projects/issues/issues.feature
@@ -7,6 +7,32 @@ Feature: Issues
And I visit project "Shop" issues page
Scenario: I should see open issues
- Given I should see "Release 0.4" open issue
- And I should not see "Release 0.3" closed issue
+ Given I should see "Release 0.4" in issues
+ And I should not see "Release 0.3" in issues
+ Scenario: I should see closed issues
+ Given I click link "Closed"
+ Then I should see "Release 0.3" in issues
+ And I should not see "Release 0.4" in issues
+
+ Scenario: I should see all issues
+ Given I click link "All"
+ Then I should see "Release 0.3" in issues
+ And I should see "Release 0.4" in issues
+
+ Scenario: I visit issue page
+ Given I click link "Release 0.4"
+ Then I should see issue "Release 0.4"
+
+ @javascript
+ Scenario: I submit new unassigned issue
+ Given I click link "New Issue"
+ And I submit new issue "500 error on profile"
+ Given I click link "500 error on profile"
+ Then I should see issue "500 error on profile"
+
+ @javascript
+ Scenario: I comment issue
+ Given I visit issue page "Release 0.4"
+ And I leave a comment like "XML attached"
+ Then I should see comment "XML attached"
diff --git a/features/projects/issues/milestones.feature b/features/projects/issues/milestones.feature
index e69de29bb2d..d78096a4f16 100644
--- a/features/projects/issues/milestones.feature
+++ b/features/projects/issues/milestones.feature
@@ -0,0 +1,18 @@
+Feature: Milestones
+ Background:
+ Given I signin as a user
+ And I own project "Shop"
+ And project "Shop" has milestone "v2.2"
+ Given I visit project "Shop" milestones page
+
+ Scenario: I should see active milestones
+ Then I should see milestone "v2.2"
+
+ Scenario: I should see milestone
+ Given I click link "v2.2"
+ Then I should see milestone "v2.2"
+
+ Scenario: I create new milestone
+ Given I click link "New Milestone"
+ And I submit new milestone "v2.3"
+ Then I should see milestone "v2.3"
diff --git a/features/projects/project.feature b/features/projects/project.feature
new file mode 100644
index 00000000000..895a928ff81
--- /dev/null
+++ b/features/projects/project.feature
@@ -0,0 +1,11 @@
+Feature: Project
+ Background:
+ Given I signin as a user
+ And I own project "Shop"
+ And I visit project "Shop" page
+
+ Scenario: I should see project activity
+
+ Scenario: I edit project
+
+ Scenario: I visit attachments
diff --git a/features/projects/source/browse_files.feature.commented b/features/projects/source/browse_files.feature
index 04aebc19732..04aebc19732 100644
--- a/features/projects/source/browse_files.feature.commented
+++ b/features/projects/source/browse_files.feature
diff --git a/features/projects/source/git_blame.feature b/features/projects/source/git_blame.feature
index e69de29bb2d..6aa6be47deb 100644
--- a/features/projects/source/git_blame.feature
+++ b/features/projects/source/git_blame.feature
@@ -0,0 +1,10 @@
+Feature: Browse git repo
+ Background:
+ Given I signin as a user
+ And I own project "Shop"
+ Given I visit project source page
+
+ Scenario: I blame file
+ Given I click on file from repo
+ And I click blame button
+ Then I should see git file blame
diff --git a/features/projects/wiki.feature b/features/projects/wiki.feature
index ed69e87c91a..4441ada2847 100644
--- a/features/projects/wiki.feature
+++ b/features/projects/wiki.feature
@@ -7,3 +7,9 @@ Feature: Wiki
Scenario: Add new page
Given I create Wiki page
Then I should see newly created wiki page
+
+ @javascript
+ Scenario: I comment wiki page
+ Given I create Wiki page
+ And I leave a comment like "XML attached"
+ Then I should see comment "XML attached"
diff --git a/features/step_definitions/profile_keys_steps.rb b/features/step_definitions/profile/profile_keys_steps.rb
index 5ab7e0480ad..5ab7e0480ad 100644
--- a/features/step_definitions/profile_keys_steps.rb
+++ b/features/step_definitions/profile/profile_keys_steps.rb
diff --git a/features/step_definitions/profile_steps.rb b/features/step_definitions/profile/profile_steps.rb
index 7510c5365e1..4661139c180 100644
--- a/features/step_definitions/profile_steps.rb
+++ b/features/step_definitions/profile/profile_steps.rb
@@ -36,3 +36,16 @@ Then /^I should see new token$/ do
find("#token").value.should == @user.reload.private_token
end
+Then /^I change my contact info$/ do
+ fill_in "user_skype", :with => "testskype"
+ fill_in "user_linkedin", :with => "testlinkedin"
+ fill_in "user_twitter", :with => "testtwitter"
+ click_button "Save"
+ @user.reload
+end
+
+Then /^I should see new contact info$/ do
+ @user.skype.should == 'testskype'
+ @user.linkedin.should == 'testlinkedin'
+ @user.twitter.should == 'testtwitter'
+end
diff --git a/features/step_definitions/browse_code_steps.rb b/features/step_definitions/project/browse_code_steps.rb
index fc3cf56a83b..7f9001bb989 100644
--- a/features/step_definitions/browse_code_steps.rb
+++ b/features/step_definitions/project/browse_code_steps.rb
@@ -38,3 +38,13 @@ end
Then /^I should see raw file content$/ do
page.source.should == ValidCommit::BLOB_FILE
end
+
+Given /^I click blame button$/ do
+ click_link "blame"
+end
+
+Then /^I should see git file blame$/ do
+ page.should have_content("rubygems.org")
+ page.should have_content("Dmitriy Zaporozhets")
+ page.should have_content("bc3735004cb Moving to rails 3.2")
+end
diff --git a/features/step_definitions/project_commits_steps.rb b/features/step_definitions/project/project_commits_steps.rb
index 9b3b0aa1f81..35fcb4d11ab 100644
--- a/features/step_definitions/project_commits_steps.rb
+++ b/features/step_definitions/project/project_commits_steps.rb
@@ -59,3 +59,30 @@ end
Given /^I visit project tags page$/ do
visit tags_project_repository_path(@project)
end
+
+Then /^I should see "(.*?)" recent branches list$/ do |arg1|
+ page.should have_content("Branches")
+ page.should have_content("master")
+end
+
+Then /^I should see "(.*?)" all branches list$/ do |arg1|
+ page.should have_content("Branches")
+ page.should have_content("master")
+end
+
+Then /^I should see "(.*?)" all tags list$/ do |arg1|
+ page.should have_content("Tags")
+ page.should have_content("v1.2.1")
+end
+
+Then /^I should see "(.*?)" protected branches list$/ do |arg1|
+ within "table" do
+ page.should have_content "stable"
+ page.should_not have_content "master"
+ end
+end
+
+Given /^project "(.*?)" has protected branches$/ do |arg1|
+ project = Project.find_by_name(arg1)
+ project.protected_branches.create(:name => "stable")
+end
diff --git a/features/step_definitions/project_issues_steps.rb b/features/step_definitions/project/project_issues_steps.rb
index e83c0e7f399..00a1721f8de 100644
--- a/features/step_definitions/project_issues_steps.rb
+++ b/features/step_definitions/project/project_issues_steps.rb
@@ -12,11 +12,27 @@ Given /^I visit project "(.*?)" issues page$/ do |arg1|
visit project_issues_path(Project.find_by_name(arg1))
end
-Given /^I should see "(.*?)" open issue$/ do |arg1|
+Given /^I should see "(.*?)" in issues$/ do |arg1|
page.should have_content arg1
end
-Given /^I should not see "(.*?)" closed issue$/ do |arg1|
+Given /^I should not see "(.*?)" in issues$/ do |arg1|
page.should_not have_content arg1
end
+Then /^I should see issue "(.*?)"$/ do |arg1|
+ issue = Issue.find_by_title(arg1)
+ page.should have_content issue.title
+ page.should have_content issue.author_name
+ page.should have_content issue.project.name
+end
+
+Given /^I visit issue page "(.*?)"$/ do |arg1|
+ issue = Issue.find_by_title(arg1)
+ visit project_issue_path(issue.project, issue)
+end
+
+Given /^I submit new issue "(.*?)"$/ do |arg1|
+ fill_in "issue_title", :with => arg1
+ click_button "Submit new issue"
+end
diff --git a/features/step_definitions/project/project_merge_requests_steps.rb b/features/step_definitions/project/project_merge_requests_steps.rb
new file mode 100644
index 00000000000..6749773e2b5
--- /dev/null
+++ b/features/step_definitions/project/project_merge_requests_steps.rb
@@ -0,0 +1,38 @@
+Given /^project "(.*?)" has milestone "(.*?)"$/ do |arg1, arg2|
+ project = Project.find_by_name(arg1)
+
+ milestone = Factory :milestone,
+ :title => arg2,
+ :project => project
+
+ 3.times do |i|
+ issue = Factory :issue,
+ :project => project,
+ :milestone => milestone
+ end
+end
+
+Given /^I visit project "(.*?)" milestones page$/ do |arg1|
+ @project = Project.find_by_name(arg1)
+ visit project_milestones_path(@project)
+end
+
+Then /^I should see active milestones$/ do
+ milestone = @project.milestones.first
+ page.should have_content(milestone.title[0..10])
+ page.should have_content(milestone.expires_at)
+ page.should have_content("Browse Issues")
+end
+
+Then /^I should see milestone "(.*?)"$/ do |arg1|
+ milestone = @project.milestones.find_by_title(arg1)
+ page.should have_content(milestone.title[0..10])
+ page.should have_content(milestone.expires_at)
+ page.should have_content("Browse Issues")
+end
+
+Given /^I submit new milestone "(.*?)"$/ do |arg1|
+ fill_in "milestone_title", :with => arg1
+ click_button "Create milestone"
+end
+
diff --git a/features/step_definitions/project_team_steps.rb b/features/step_definitions/project/project_team_steps.rb
index f0bab29a6f8..f0bab29a6f8 100644
--- a/features/step_definitions/project_team_steps.rb
+++ b/features/step_definitions/project/project_team_steps.rb
diff --git a/features/step_definitions/project_wiki_steps.rb b/features/step_definitions/project/project_wiki_steps.rb
index 10de38d9ae3..10de38d9ae3 100644
--- a/features/step_definitions/project_wiki_steps.rb
+++ b/features/step_definitions/project/project_wiki_steps.rb
diff --git a/features/step_definitions/projects_steps.rb b/features/step_definitions/project/projects_steps.rb
index bca1213908d..c9af346e7cf 100644
--- a/features/step_definitions/projects_steps.rb
+++ b/features/step_definitions/project/projects_steps.rb
@@ -50,6 +50,11 @@ Given /^I write new comment "(.*?)"$/ do |arg1|
click_button "Add Comment"
end
+Given /^I visit project "(.*?)" page$/ do |arg1|
+ project = Project.find_by_name(arg1)
+ visit project_path(project)
+end
+
Given /^I visit project "(.*?)" network page$/ do |arg1|
project = Project.find_by_name(arg1)
visit graph_project_path(project)
@@ -66,3 +71,12 @@ Given /^page should have network graph$/ do
page.should have_content "notes_refacto..."
end
end
+
+Given /^I leave a comment like "(.*?)"$/ do |arg1|
+ fill_in "note_note", :with => arg1
+ click_button "Add Comment"
+end
+
+Then /^I should see comment "(.*?)"$/ do |arg1|
+ page.should have_content(arg1)
+end
diff --git a/spec/monkeypatch.rb b/spec/monkeypatch.rb
index 6133631c5de..93dda0174c6 100644
--- a/spec/monkeypatch.rb
+++ b/spec/monkeypatch.rb
@@ -44,4 +44,8 @@ class FakeSatellite
end
end
-
+class ProtectedBranch
+ def update_repository
+ true
+ end
+end
diff --git a/spec/requests/dashboard_issues_spec.rb b/spec/requests/atom/dashboard_issues_spec.rb
index 29c79313f7e..7260dcf47bf 100644
--- a/spec/requests/dashboard_issues_spec.rb
+++ b/spec/requests/atom/dashboard_issues_spec.rb
@@ -30,14 +30,6 @@ describe "User Issues Dashboard" do
visit dashboard_issues_path
end
- subject { page }
-
- it { should have_content(@issue1.title[0..10]) }
- it { should have_content(@issue1.project.name) }
-
- it { should have_content(@issue2.title[0..10]) }
- it { should have_content(@issue2.project.name) }
-
describe "atom feed", :js => false do
it "should render atom feed via private token" do
logout
diff --git a/spec/requests/dashboard_spec.rb b/spec/requests/atom/dashboard_spec.rb
index 16ededd02af..4db8ce49ff7 100644
--- a/spec/requests/dashboard_spec.rb
+++ b/spec/requests/atom/dashboard_spec.rb
@@ -10,18 +10,6 @@ describe "User Dashboard" do
visit dashboard_path
end
- it "should be on projects page" do
- current_path.should == dashboard_path
- end
-
- it "should have link to new project" do
- page.should have_content("New Project")
- end
-
- it "should have project" do
- page.should have_content(@project.name)
- end
-
it "should render projects atom feed via private token" do
logout
diff --git a/spec/requests/atom/issues_spec.rb b/spec/requests/atom/issues_spec.rb
new file mode 100644
index 00000000000..8d0b6c4f3fd
--- /dev/null
+++ b/spec/requests/atom/issues_spec.rb
@@ -0,0 +1,40 @@
+require 'spec_helper'
+
+describe "Issues" do
+ let(:project) { Factory :project }
+
+ before do
+ login_as :user
+ project.add_access(@user, :read, :write)
+ end
+
+ describe "GET /issues" do
+ before do
+ @issue = Factory :issue,
+ :author => @user,
+ :assignee => @user,
+ :project => project
+
+ visit project_issues_path(project)
+ end
+
+ it "should render atom feed" do
+ visit project_issues_path(project, :atom)
+
+ page.response_headers['Content-Type'].should have_content("application/atom+xml")
+ page.body.should have_selector("title", :text => "#{project.name} issues")
+ page.body.should have_selector("author email", :text => @issue.author_email)
+ page.body.should have_selector("entry summary", :text => @issue.title)
+ end
+
+ it "should render atom feed via private token" do
+ logout
+ visit project_issues_path(project, :atom, :private_token => @user.private_token)
+
+ page.response_headers['Content-Type'].should have_content("application/atom+xml")
+ page.body.should have_selector("title", :text => "#{project.name} issues")
+ page.body.should have_selector("author email", :text => @issue.author_email)
+ page.body.should have_selector("entry summary", :text => @issue.title)
+ end
+ end
+end
diff --git a/spec/requests/commits_notes_spec.rb b/spec/requests/commits_notes_spec.rb
deleted file mode 100644
index fde42a8f55e..00000000000
--- a/spec/requests/commits_notes_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-
-describe "Issues" do
- let(:project) { Factory :project }
- let!(:commit) { project.repo.commits.first }
-
- before do
- login_as :user
- project.add_access(@user, :read, :write)
- end
-
- describe "add new note", :js => true do
- before do
- visit project_commit_path(project, commit)
- fill_in "note_note", :with => "I commented this commit"
- click_button "Add Comment"
- end
-
- it "should conatin new note" do
- page.should have_content("I commented this commit")
- end
-
- it "should be displayed when i visit this commit again" do
- visit project_commit_path(project, commit)
- page.should have_content("I commented this commit")
- end
- end
-end
diff --git a/spec/requests/commits_spec.rb b/spec/requests/commits_spec.rb
deleted file mode 100644
index ae36a932ae0..00000000000
--- a/spec/requests/commits_spec.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require 'spec_helper'
-
-describe "Commits" do
- let(:project) { Factory :project }
- let!(:commit) { CommitDecorator.decorate(project.commit) }
- before do
- login_as :user
- project.add_access(@user, :read)
- end
-
- describe "GET /commits" do
- before do
- visit project_commits_path(project)
- end
-
- it "should have valid path" do
- current_path.should == project_commits_path(project)
- end
-
- it "should have project name" do
- page.should have_content(project.name)
- end
-
- it "should list commits" do
- page.should have_content(commit.description)
- page.should have_content(commit.short_id(8))
- end
-
- it "should render atom feed" do
- visit project_commits_path(project, :atom)
-
- page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", :text => "Recent commits to #{project.name}")
- page.body.should have_selector("author email", :text => commit.author_email)
- page.body.should have_selector("entry summary", :text => commit.description)
- end
-
- it "should render atom feed via private token" do
- logout
- visit project_commits_path(project, :atom, :private_token => @user.private_token)
-
- page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", :text => "Recent commits to #{project.name}")
- page.body.should have_selector("author email", :text => commit.author_email)
- page.body.should have_selector("entry summary", :text => commit.description)
- end
- end
-
- describe "GET /commits/:id" do
- before do
- visit project_commit_path(project, commit.id)
- end
-
- it "should have valid path" do
- current_path.should == project_commit_path(project, commit.id)
- end
- end
-
- describe "GET /commits/compare" do
- before do
- visit compare_project_commits_path(project)
- end
-
- it "should have valid path" do
- current_path.should == compare_project_commits_path(project)
- end
- end
-end
diff --git a/spec/requests/dashboard_merge_requests_spec.rb b/spec/requests/dashboard_merge_requests_spec.rb
deleted file mode 100644
index f345a858ac8..00000000000
--- a/spec/requests/dashboard_merge_requests_spec.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'spec_helper'
-
-describe "User MergeRequests" do
- describe "GET /issues" do
- before do
-
- login_as :user
-
- @project1 = Factory :project,
- :path => "project1",
- :code => "TEST1"
-
- @project2 = Factory :project,
- :path => "project2",
- :code => "TEST2"
-
- @project1.add_access(@user, :read, :write)
- @project2.add_access(@user, :read, :write)
-
- @merge_request1 = Factory :merge_request,
- :author => @user,
- :assignee => @user,
- :project => @project1
-
- @merge_request2 = Factory :merge_request,
- :author => @user,
- :assignee => @user,
- :project => @project2
-
- visit dashboard_merge_requests_path
- end
-
- subject { page }
-
- it { should have_content(@merge_request1.title[0..10]) }
- it { should have_content(@merge_request1.project.name) }
- it { should have_content(@merge_request2.title[0..10]) }
- it { should have_content(@merge_request2.project.name) }
- end
-end
diff --git a/spec/requests/file_blame_spec.rb b/spec/requests/file_blame_spec.rb
deleted file mode 100644
index 511f340c1c8..00000000000
--- a/spec/requests/file_blame_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'spec_helper'
-
-describe "Blame file" do
- before { login_as :user }
-
- describe "GET /:projectname/:commit/blob/Gemfile" do
- before do
- @project = Factory :project
- @project.add_access(@user, :read)
-
- visit tree_project_ref_path(@project, @project.root_ref, :path => "Gemfile")
- click_link "blame"
- end
-
- it "should be correct path" do
- current_path.should == blame_file_project_ref_path(@project, @project.root_ref, :path => "Gemfile")
- end
-
- it "should contain file view" do
- page.should have_content("rubygems.org")
- page.should have_content("Dmitriy Zaporozhets")
- page.should have_content("bc3735004cb Moving to rails 3.2")
- end
- end
-end
diff --git a/spec/requests/issues_notes_spec.rb b/spec/requests/issues_notes_spec.rb
deleted file mode 100644
index 538098e60bd..00000000000
--- a/spec/requests/issues_notes_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-
-describe "Issues" do
- let(:project) { Factory :project }
-
- before do
- login_as :user
- project.add_access(@user, :read, :write)
-
- @issue = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project
- end
-
- describe "add new note", :js => true do
- before do
- visit project_issue_path(project, @issue)
- fill_in "note_note", :with => "I commented this issue"
- click_button "Add Comment"
- end
-
- it "should conatin new note" do
- page.should have_content("I commented this issue")
- end
- end
-end
diff --git a/spec/requests/issues_spec.rb b/spec/requests/issues_spec.rb
index 2c8650a8402..ad7b0432f42 100644
--- a/spec/requests/issues_spec.rb
+++ b/spec/requests/issues_spec.rb
@@ -11,161 +11,6 @@ describe "Issues" do
project.add_access(@user2, :read, :write)
end
- describe "GET /issues" do
- before do
- @issue = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project
-
- visit project_issues_path(project)
- end
-
- subject { page }
-
- it { should have_content(@issue.title[0..20]) }
- it { should have_content(@issue.project.name) }
- it { should have_content(@issue.assignee.name) }
-
- it "should render atom feed" do
- visit project_issues_path(project, :atom)
-
- page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", :text => "#{project.name} issues")
- page.body.should have_selector("author email", :text => @issue.author_email)
- page.body.should have_selector("entry summary", :text => @issue.title)
- end
-
- it "should render atom feed via private token" do
- logout
- visit project_issues_path(project, :atom, :private_token => @user.private_token)
-
- page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", :text => "#{project.name} issues")
- page.body.should have_selector("author email", :text => @issue.author_email)
- page.body.should have_selector("entry summary", :text => @issue.title)
- end
-
- describe "statuses" do
- before do
- @closed_issue = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project,
- :closed => true
- end
-
- it "should show only open" do
- should have_content(@issue.title[0..25])
- should have_no_content(@closed_issue.title)
- end
-
- it "should show only closed" do
- click_link "Closed"
- should have_no_content(@issue.title)
- should have_content(@closed_issue.title[0..25])
- end
-
- it "should show all" do
- click_link "All"
- should have_content(@issue.title[0..25])
- should have_content(@closed_issue.title[0..25])
- end
- end
- end
-
- describe "New issue", :js => true do
- before do
- visit project_issues_path(project)
- click_link "New Issue"
- end
-
- it "should open new issue form" do
- page.should have_content("New Issue")
- end
-
- describe "fill in" do
- describe 'assign to me' do
- before do
- fill_in "issue_title", :with => "bug 345"
- page.execute_script("$('#issue_assignee_id').show();")
- select @user.name, :from => "issue_assignee_id"
- end
-
- it { expect { click_button "Submit new issue" }.to change {Issue.count}.by(1) }
-
- it "should add new issue to table" do
- click_button "Submit new issue"
-
- page.should_not have_content("Add new issue")
- page.should have_content @user.name
- page.should have_content "bug 345"
- page.should have_content project.name
- end
-
- it "should call send mail" do
- Notify.should_not_receive(:new_issue_email)
- click_button "Submit new issue"
- end
- end
-
- describe 'assign to other' do
- before do
- fill_in "issue_title", :with => "bug 345"
- page.execute_script("$('#issue_assignee_id').show();")
- select @user2.name, :from => "issue_assignee_id"
- end
-
- it { expect { click_button "Submit new issue" }.to change {Issue.count}.by(1) }
-
- it "should add new issue to table" do
- click_button "Submit new issue"
-
- page.should_not have_content("Add new issue")
- page.should have_content @user2.name
- page.should have_content "bug 345"
- page.should have_content project.name
- end
-
- it "should call send mail" do
- Issue.observers.enable :issue_observer do
- Notify.should_receive(:new_issue_email).and_return(stub(:deliver => true))
- click_button "Submit new issue"
- end
- end
-
- it "should send valid email to user" do
- Issue.observers.enable :issue_observer do
- with_resque do
- click_button "Submit new issue"
- end
- issue = Issue.last
- email = ActionMailer::Base.deliveries.last
- email.subject.should have_content("New Issue was created")
- email.body.should have_content(issue.title)
- end
- end
-
- end
- end
- end
-
- describe "Show issue" do
- before do
- @issue = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project
-
- visit project_issue_path(project, @issue)
- end
-
- it "should have valid show page for issue" do
- page.should have_content @issue.title
- page.should have_content @user.name
- end
- end
-
describe "Edit issue", :js => true do
before do
@issue = Factory :issue,
diff --git a/spec/requests/keys_spec.rb b/spec/requests/keys_spec.rb
deleted file mode 100644
index 2bc7c75ba0d..00000000000
--- a/spec/requests/keys_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'spec_helper'
-
-describe "Issues" do
- before do
- login_as :user
- end
-
- describe "GET /keys" do
- before do
- @key = Factory :key, :user => @user
- visit keys_path
- end
-
- subject { page }
-
- it { should have_content(@key.title) }
-
- describe "Destroy" do
- before { visit key_path(@key) }
-
- it "should remove entry" do
- expect {
- click_link "Remove"
- }.to change { @user.keys.count }.by(-1)
- end
- end
- end
-
- describe "New key" do
- before do
- visit keys_path
- click_link "Add new"
- end
-
- it "should open new key popup" do
- page.should have_content("New key")
- end
-
- describe "fill in" do
- before do
- fill_in "key_title", :with => "laptop"
- fill_in "key_key", :with => "publickey234="
- end
-
- it { expect { click_button "Save" }.to change {Key.count}.by(1) }
-
- it "should add new key to table" do
- click_button "Save"
-
- page.should_not have_content("New key")
- page.should have_content "laptop"
- end
- end
- end
-
- describe "Show page" do
- before do
- @key = Factory :key, :user => @user
- visit key_path(@key)
- end
-
- it { page.should have_content @key.title }
- it { page.should have_content @key.key[0..10] }
- end
-end
diff --git a/spec/requests/last_push_widget_spec.rb b/spec/requests/last_push_widget_spec.rb
deleted file mode 100644
index 0baa20c6e94..00000000000
--- a/spec/requests/last_push_widget_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'spec_helper'
-
-describe "Last Push widget" do
- before { login_as :user }
-
- before do
- @project = Factory :project, :owner => @user
- @project.add_access(@user, :read)
- create_push_event
- visit dashboard_path
- end
-
- it "should display last push widget with link to merge request page" do
- page.should have_content "Your pushed to branch new_design"
- page.should have_link "Create Merge Request"
- end
-
- describe "click create MR" do
- before { click_link "Create Merge Request" }
-
- it { current_path.should == new_project_merge_request_path(@project) }
- it { find("#merge_request_source_branch").value.should == "new_design" }
- it { find("#merge_request_target_branch").value.should == "master" }
- it { find("#merge_request_title").value.should == "New Design" }
- end
-
-
- def create_push_event
- data = {
- :before => "0000000000000000000000000000000000000000",
- :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
- :ref => "refs/heads/new_design",
- :user_id => @user.id,
- :user_name => @user.name,
- :repository => {
- :name => @project.name,
- :url => "localhost/rubinius",
- :description => "",
- :homepage => "localhost/rubinius",
- :private => true
- }
- }
-
- @event = Event.create(
- :project => @project,
- :action => Event::Pushed,
- :data => data,
- :author_id => @user.id
- )
- end
-end
-
diff --git a/spec/requests/milestones_spec.rb b/spec/requests/milestones_spec.rb
deleted file mode 100644
index f1d5023e6b4..00000000000
--- a/spec/requests/milestones_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'spec_helper'
-
-describe "Milestones" do
- let(:project) { Factory :project }
-
- before do
- login_as :user
- project.add_access(@user, :admin)
-
- @milestone = Factory :milestone, :project => project
- @issue = Factory :issue, :project => project
-
- @milestone.issues << @issue
- end
-
- describe "GET /milestones" do
- before do
- visit project_milestones_path(project)
- end
-
- subject { page }
-
- it { should have_content(@milestone.title[0..10]) }
- it { should have_content(@milestone.expires_at) }
- it { should have_content("Browse Issues") }
- end
-
- describe "GET /milestone/:id" do
- before do
- visit project_milestone_path(project, @milestone)
- end
-
- subject { page }
-
- it { should have_content(@milestone.title[0..10]) }
- it { should have_content(@milestone.expires_at) }
- it { should have_content("Browse Issues") }
- end
-
- describe "GET /milestones/new" do
- before do
- visit new_project_milestone_path(project)
- fill_in "milestone_title", :with => "v2.3"
- click_button "Create milestone"
- end
-
- it { current_path.should == project_milestone_path(project, project.milestones.last) }
- it { page.should have_content(project.milestones.last.title[0..10]) }
- it { page.should have_content(project.milestones.last.expires_at) }
- end
-end
diff --git a/spec/requests/profile_spec.rb b/spec/requests/profile_spec.rb
deleted file mode 100644
index 6f9af6085ab..00000000000
--- a/spec/requests/profile_spec.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-require 'spec_helper'
-
-describe "Profile" do
- before do
- login_as :user
- end
-
- describe "Show profile" do
- before do
- visit profile_path
- end
-
- it { page.should have_content(@user.name) }
- end
-
- describe "Profile update" do
- before do
- visit profile_path
- fill_in "user_skype", :with => "testskype"
- fill_in "user_linkedin", :with => "testlinkedin"
- fill_in "user_twitter", :with => "testtwitter"
- click_button "Save"
- @user.reload
- end
-
- it { @user.skype.should == 'testskype' }
- it { @user.linkedin.should == 'testlinkedin' }
- it { @user.twitter.should == 'testtwitter' }
- end
-
- describe "Reset private token" do
- before do
- visit profile_token_path
- end
-
- it "should reset private token" do
- user_first_token = @user.private_token
- click_button "Reset"
- @user.reload
- @user.private_token.should_not == user_first_token
- end
- end
-
- describe "Password update" do
- before do
- visit profile_password_path
- end
-
- it { page.should have_content("Password") }
- it { page.should have_content("Password confirmation") }
-
- describe "change password" do
- before do
- @old_pwd = @user.encrypted_password
- fill_in "user_password", :with => "777777"
- fill_in "user_password_confirmation", :with => "777777"
- click_button "Save"
- @user.reload
- end
-
- it "should redirect to signin page" do
- current_path.should == new_user_session_path
- end
-
- it "should change password" do
- @user.encrypted_password.should_not == @old_pwd
- end
-
- describe "login with new password" do
- before do
- fill_in "user_email", :with => @user.email
- fill_in "user_password", :with => "777777"
- click_button "Sign in"
- end
-
- it "should login user" do
- current_path.should == root_path
- end
- end
- end
- end
-end
diff --git a/spec/requests/projects_spec.rb b/spec/requests/projects_spec.rb
index c9c348469cc..f96affc75bc 100644
--- a/spec/requests/projects_spec.rb
+++ b/spec/requests/projects_spec.rb
@@ -3,47 +3,6 @@ require 'spec_helper'
describe "Projects" do
before { login_as :user }
- describe "GET /projects/new" do
- before do
- visit root_path
- click_link "New Project"
- end
-
- it "should be correct path" do
- current_path.should == new_project_path
- end
-
- it "should have labels for new project" do
- page.should have_content("Project name is")
- end
- end
-
- describe "POST /projects" do
- before do
- visit new_project_path
- fill_in 'project_name', :with => 'NewProject'
- fill_in 'project_code', :with => 'NPR'
- fill_in 'project_path', :with => 'newproject'
- expect { click_button "Create project" }.to change { Project.count }.by(1)
- @project = Project.last
- end
-
- it "should be correct path" do
- current_path.should == project_path(@project)
- end
-
- it "should show project" do
- page.should have_content(@project.name)
- page.should have_content(@project.path)
- page.should have_content(@project.description)
- end
-
- it "should init repo instructions" do
- page.should have_content("git remote")
- page.should have_content(@project.url_to_repo)
- end
- end
-
describe "GET /projects/show" do
before do
@project = Factory :project, :owner => @user
@@ -57,42 +16,6 @@ describe "Projects" do
end
end
- describe "GET /projects/graph" do
- before do
- @project = Factory :project
- @project.add_access(@user, :read)
-
- visit graph_project_path(@project)
- end
-
- it "should be correct path" do
- current_path.should == graph_project_path(@project)
- end
-
- it "should have as as team member" do
- page.should have_content("master")
- end
- end
-
- describe "GET /projects/team" do
- before do
- @project = Factory :project
- @project.add_access(@user, :read)
-
- visit team_project_path(@project,
- :path => ValidCommit::BLOB_FILE_PATH,
- :commit_id => ValidCommit::ID)
- end
-
- it "should be correct path" do
- current_path.should == team_project_path(@project)
- end
-
- it "should have as as team member" do
- page.should have_content(@user.name)
- end
- end
-
describe "GET /projects/:id/edit" do
before do
@project = Factory :project
diff --git a/spec/requests/projects_tree_spec.rb b/spec/requests/projects_tree_spec.rb
deleted file mode 100644
index acc4f0b9674..00000000000
--- a/spec/requests/projects_tree_spec.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-require 'spec_helper'
-
-describe "Projects" do
- before { login_as :user }
-
- describe "GET /projects/tree" do
- describe "head" do
- before do
- @project = Factory :project
- @project.add_access(@user, :read)
-
- visit tree_project_ref_path(@project, @project.root_ref)
- end
-
- it "should be correct path" do
- current_path.should == tree_project_ref_path(@project, @project.root_ref)
- end
-
- it_behaves_like :tree_view
- end
-
- describe ValidCommit::ID do
- before do
- @project = Factory :project
- @project.add_access(@user, :read)
-
- visit tree_project_ref_path(@project, ValidCommit::ID)
- end
-
- it "should be correct path" do
- current_path.should == tree_project_ref_path(@project, ValidCommit::ID)
- end
-
- it_behaves_like :tree_view
- it_behaves_like :project_side_pane
- end
-
- describe "branch passed" do
- before do
- @project = Factory :project
- @project.add_access(@user, :read)
-
- visit tree_project_ref_path(@project, @project.root_ref)
- end
-
- it "should be correct path" do
- current_path.should == tree_project_ref_path(@project, @project.root_ref)
- end
-
- it_behaves_like :tree_view
- it_behaves_like :project_side_pane
- end
-
- # TREE FILE PREVIEW
- describe "file preview" do
- before do
- @project = Factory :project
- @project.add_access(@user, :read)
-
- visit tree_project_ref_path(@project, @project.root_ref, :path => "Gemfile")
- end
-
- it "should be correct path" do
- current_path.should == tree_project_ref_path(@project, @project.root_ref)
- end
-
- it "should contain file view" do
- page.should have_content("rubygems.org")
- end
- end
- end
-
- # RAW FILE
- describe "GET /projects/blob" do
- before do
- @project = Factory :project
- @project.add_access(@user, :read)
-
- visit blob_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH)
- end
-
- it "should be correct path" do
- current_path.should == blob_project_ref_path(@project, ValidCommit::ID)
- end
-
- it "raw file response" do
- page.source.should == ValidCommit::BLOB_FILE
- end
- end
-end
diff --git a/spec/requests/projects_wall_spec.rb b/spec/requests/projects_wall_spec.rb
deleted file mode 100644
index b2708fd1a57..00000000000
--- a/spec/requests/projects_wall_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'spec_helper'
-
-describe "Projects", "Wall" do
- let(:project) { Factory :project }
-
- before do
- login_as :user
- project.add_access(@user, :read, :write)
- end
-
- describe "View notes on wall", :js => true do
- before do
- Factory :note, :project => project, :note => "Project specs", :author => @user
- visit wall_project_path(project)
- end
-
- it { page.should have_content("Project specs") }
- it { page.should have_content(@user.name) }
- it { page.should have_content("less than a minute ago") }
- end
-
- describe "add new note", :js => true do
- before do
- visit wall_project_path(project)
- fill_in "note_note", :with => "my post on wall"
- click_button "Add Comment"
- end
-
- it "should conatin new note" do
- page.should have_content("my post on wall")
- end
- end
-end
diff --git a/spec/requests/repositories_spec.rb b/spec/requests/repositories_spec.rb
deleted file mode 100644
index 1bf4c8d24b7..00000000000
--- a/spec/requests/repositories_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require 'spec_helper'
-
-describe "Repository" do
-
- before do
- @user = Factory :user
- @project = Factory :project
- @project.add_access(@user, :read, :write)
- login_with @user
- end
-
- describe "GET /:project_name/repository" do
- before do
- visit project_repository_path(@project)
- end
-
- it "should be on projects page" do
- current_path.should == project_repository_path(@project)
- end
-
- it "should have link to last commit for activities tab" do
- page.should have_content(@project.commit.safe_message[0..20])
- end
- end
-
- describe "GET /:project_name/repository/branches" do
- before do
- visit branches_project_repository_path(@project)
- end
-
- it "should have link to repo activities" do
- page.should have_content("Branches")
- page.should have_content("master")
- end
- end
-
- # TODO: Add new repo to seeds with tags list
- describe "GET /:project_name/repository/tags" do
- before do
- visit tags_project_repository_path(@project)
- end
-
- it "should have link to repo activities" do
- page.should have_content("Tags")
- page.should have_content("v1.2.1")
- end
- end
-end
-
diff --git a/spec/requests/user_security_spec.rb b/spec/requests/security/profile_access_spec.rb
index b75a1779a8a..b8ed27f031c 100644
--- a/spec/requests/user_security_spec.rb
+++ b/spec/requests/security/profile_access_spec.rb
@@ -7,9 +7,6 @@ describe "Users Security" do
end
describe "GET /login" do
- #it { new_user_session_path.should be_denied_for @u1 }
- #it { new_user_session_path.should be_denied_for :admin }
- #it { new_user_session_path.should be_denied_for :user }
it { new_user_session_path.should_not be_404_for :visitor }
end
diff --git a/spec/requests/projects_security_spec.rb b/spec/requests/security/project_access_spec.rb
index df4d11221c3..bcca42f5298 100644
--- a/spec/requests/projects_security_spec.rb
+++ b/spec/requests/security/project_access_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe "Projects Security" do
+describe "Application access" do
describe "GET /" do
it { root_path.should be_allowed_for :admin }
it { root_path.should be_allowed_for :user }
diff --git a/spec/requests/team_members_spec.rb b/spec/requests/team_members_spec.rb
deleted file mode 100644
index 34e34f59bdb..00000000000
--- a/spec/requests/team_members_spec.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require 'spec_helper'
-
-describe "TeamMembers" do
- before do
- login_as :user
- @project = Factory :project
- @project.add_access(@user, :read, :admin)
- end
-
- describe "Update profile", :js => true do
- it "should update user role" do
- @project.master_access_for?(@user).should be_true
- visit team_project_path(@project)
- select "Developer", :from => "team_member_project_access"
- @project.master_access_for?(@user).should be_false
- @project.dev_access_for?(@user).should be_true
- end
- end
-
- describe "View profile" do
- it "should be available" do
- visit(team_project_path(@project))
- click_link(@user.name)
- page.should have_content @user.skype
- page.should_not have_content 'Twitter'
- end
- end
-
- describe "New Team member" do
- before do
- @user_1 = Factory :user
- visit team_project_path(@project)
- click_link "New Team Member"
- end
-
- it "should open new team member popup" do
- page.should have_content("New Team member")
- end
-
- describe "fill in" do
- before do
- within "#new_team_member" do
- select @user_1.name, :from => "team_member_user_id"
- select "Reporter", :from => "team_member_project_access"
- end
- end
-
- it { expect { click_button "Save";sleep(1) }.to change {UsersProject.count}.by(1) }
-
- it "should add new member to table" do
- click_button "Save"
- @member = UsersProject.last
-
- page.should have_content @user_1.name
-
- @member.reload
- @member.project_access.should == UsersProject::REPORTER
- end
- end
- end
-
- describe "Cancel membership" do
- it "should cancel membership" do
- visit project_team_member_path(@project, @project.users_projects.last)
- expect { click_link "Remove from team" }.to change { UsersProject.count }.by(-1)
- end
- end
-end
diff --git a/spec/requests/wikis_notes_spec.rb b/spec/requests/wikis_notes_spec.rb
deleted file mode 100644
index 144d0318bea..00000000000
--- a/spec/requests/wikis_notes_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require 'spec_helper'
-
-describe "Wikis" do
- let(:project) { Factory :project }
-
- before do
- login_as :user
- project.add_access(@user, :read, :write)
- end
-
- describe "add new note", :js => true do
- before do
- visit project_wiki_path(project, :index)
-
- fill_in "Title", :with => 'Test title'
- fill_in "Content", :with => '[link test](test)'
- click_on "Save"
-
- page.should have_content("Test title")
-
- fill_in "note_note", :with => "Comment on wiki!"
- click_button "Add Comment"
- end
-
- it "should contain the new note" do
- page.should have_content("Comment on wiki!")
- end
- end
-end
diff --git a/spec/requests/wikis_spec.rb b/spec/requests/wikis_spec.rb
deleted file mode 100644
index fd66b5e4300..00000000000
--- a/spec/requests/wikis_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'spec_helper'
-
-describe "Wiki" do
- let(:project) { Factory :project }
-
- before do
- login_as :user
- project.add_access(@user, :read, :write)
- end
-
- describe "Add pages" do
- before do
- visit project_wiki_path(project, :index)
- end
-
- it "should see form" do
- page.should have_content("Editing page")
- end
-
- it "should see added page" do
- fill_in "Title", :with => 'Test title'
- fill_in "Content", :with => '[link test](test)'
- click_on "Save"
-
- page.should have_content("Test title")
- page.should have_content("link test")
-
- click_link "link test"
-
- page.should have_content("Editing page")
- end
-
- end
-
-end