summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-08-03 19:29:54 +0300
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-08-03 19:29:54 +0300
commit6de488259701af4b69282ad105882dba423fb666 (patch)
tree57015b8f32aac9c4785c0c4f13ef9803ed3f4e89
parent3079687b93bb957cdbe857bcb49b7a1834e2004b (diff)
downloadgitlab-ce-6de488259701af4b69282ad105882dba423fb666.tar.gz
Remove duplicate coverage in spec requests. All features should be covered in cucumber
-rw-r--r--features/dashboard/dashboard.feature2
-rw-r--r--features/profile/profile.feature6
-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/step_definitions/browse_code_steps.rb10
-rw-r--r--features/step_definitions/profile_steps.rb13
-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/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/keys_spec.rb65
-rw-r--r--spec/requests/last_push_widget_spec.rb52
-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/wikis_spec.rb35
18 files changed, 39 insertions, 589 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/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/step_definitions/browse_code_steps.rb b/features/step_definitions/browse_code_steps.rb
index fc3cf56a83b..7f9001bb989 100644
--- a/features/step_definitions/browse_code_steps.rb
+++ b/features/step_definitions/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/profile_steps.rb b/features/step_definitions/profile_steps.rb
index 7510c5365e1..4661139c180 100644
--- a/features/step_definitions/profile_steps.rb
+++ b/features/step_definitions/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/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/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/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/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/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