Commit 6de488259701af4b69282ad105882dba423fb666
1 parent
3079687b
Exists in
master
and in
4 other branches
Remove duplicate coverage in spec requests. All features should be covered in cucumber
Showing
21 changed files
with
136 additions
and
686 deletions
Show diff stats
features/dashboard/dashboard.feature
| ... | ... | @@ -10,7 +10,7 @@ Feature: Dashboard |
| 10 | 10 | Then I should see "Shop" project link |
| 11 | 11 | Then I should see project "Shop" activity feed |
| 12 | 12 | |
| 13 | - Scenario: I should see last pish widget | |
| 13 | + Scenario: I should see last push widget | |
| 14 | 14 | Then I should see last push widget |
| 15 | 15 | And I click "Create Merge Request" link |
| 16 | 16 | Then I see prefilled new Merge Request page | ... | ... |
features/profile/profile.feature
| ... | ... | @@ -6,6 +6,11 @@ Feature: Profile |
| 6 | 6 | Given I visit profile page |
| 7 | 7 | Then I should see my profile info |
| 8 | 8 | |
| 9 | + Scenario: I edit profile | |
| 10 | + Given I visit profile page | |
| 11 | + Then I change my contact info | |
| 12 | + And I should see new contact info | |
| 13 | + | |
| 9 | 14 | Scenario: I change my password |
| 10 | 15 | Given I visit profile password page |
| 11 | 16 | Then I change my password |
| ... | ... | @@ -15,4 +20,3 @@ Feature: Profile |
| 15 | 20 | Given I visit profile token page |
| 16 | 21 | Then I reset my token |
| 17 | 22 | And I should see new token |
| 18 | - | ... | ... |
| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | +Feature: Browse git repo | |
| 2 | + Background: | |
| 3 | + Given I signin as a user | |
| 4 | + And I own project "Shop" | |
| 5 | + Given I visit project source page | |
| 6 | + | |
| 7 | + Scenario: I browse files from master branch | |
| 8 | + Then I should see files from repository | |
| 9 | + | |
| 10 | + Scenario: I browse files for specific ref | |
| 11 | + Given I visit project source page for "8470d70" | |
| 12 | + Then I should see files from repository for "8470d70" | |
| 13 | + | |
| 14 | + Scenario: I browse file content | |
| 15 | + Given I click on file from repo | |
| 16 | + Then I should see it content | |
| 17 | + | |
| 18 | + Scenario: I browse raw file | |
| 19 | + Given I visit blob file from repo | |
| 20 | + And I click on raw button | |
| 21 | + Then I should see raw file content | |
| 22 | + | |
| 23 | + | ... | ... |
features/projects/source/browse_files.feature.commented
| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | -Feature: Browse git repo | |
| 2 | - Background: | |
| 3 | - Given I signin as a user | |
| 4 | - And I own project "Shop" | |
| 5 | - Given I visit project source page | |
| 6 | - | |
| 7 | - Scenario: I browse files from master branch | |
| 8 | - Then I should see files from repository | |
| 9 | - | |
| 10 | - Scenario: I browse files for specific ref | |
| 11 | - Given I visit project source page for "8470d70" | |
| 12 | - Then I should see files from repository for "8470d70" | |
| 13 | - | |
| 14 | - Scenario: I browse file content | |
| 15 | - Given I click on file from repo | |
| 16 | - Then I should see it content | |
| 17 | - | |
| 18 | - Scenario: I browse raw file | |
| 19 | - Given I visit blob file from repo | |
| 20 | - And I click on raw button | |
| 21 | - Then I should see raw file content | |
| 22 | - | |
| 23 | - |
features/projects/source/git_blame.feature
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | +Feature: Browse git repo | |
| 2 | + Background: | |
| 3 | + Given I signin as a user | |
| 4 | + And I own project "Shop" | |
| 5 | + Given I visit project source page | |
| 6 | + | |
| 7 | + Scenario: I blame file | |
| 8 | + Given I click on file from repo | |
| 9 | + And I click blame button | |
| 10 | + Then I should see git file blame | ... | ... |
features/step_definitions/browse_code_steps.rb
| ... | ... | @@ -38,3 +38,13 @@ end |
| 38 | 38 | Then /^I should see raw file content$/ do |
| 39 | 39 | page.source.should == ValidCommit::BLOB_FILE |
| 40 | 40 | end |
| 41 | + | |
| 42 | +Given /^I click blame button$/ do | |
| 43 | + click_link "blame" | |
| 44 | +end | |
| 45 | + | |
| 46 | +Then /^I should see git file blame$/ do | |
| 47 | + page.should have_content("rubygems.org") | |
| 48 | + page.should have_content("Dmitriy Zaporozhets") | |
| 49 | + page.should have_content("bc3735004cb Moving to rails 3.2") | |
| 50 | +end | ... | ... |
features/step_definitions/profile_steps.rb
| ... | ... | @@ -36,3 +36,16 @@ Then /^I should see new token$/ do |
| 36 | 36 | find("#token").value.should == @user.reload.private_token |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | +Then /^I change my contact info$/ do | |
| 40 | + fill_in "user_skype", :with => "testskype" | |
| 41 | + fill_in "user_linkedin", :with => "testlinkedin" | |
| 42 | + fill_in "user_twitter", :with => "testtwitter" | |
| 43 | + click_button "Save" | |
| 44 | + @user.reload | |
| 45 | +end | |
| 46 | + | |
| 47 | +Then /^I should see new contact info$/ do | |
| 48 | + @user.skype.should == 'testskype' | |
| 49 | + @user.linkedin.should == 'testlinkedin' | |
| 50 | + @user.twitter.should == 'testtwitter' | |
| 51 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,47 @@ |
| 1 | +require 'spec_helper' | |
| 2 | + | |
| 3 | +describe "User Issues Dashboard" do | |
| 4 | + describe "GET /issues" do | |
| 5 | + before do | |
| 6 | + | |
| 7 | + login_as :user | |
| 8 | + | |
| 9 | + @project1 = Factory :project, | |
| 10 | + :path => "project1", | |
| 11 | + :code => "TEST1" | |
| 12 | + | |
| 13 | + @project2 = Factory :project, | |
| 14 | + :path => "project2", | |
| 15 | + :code => "TEST2" | |
| 16 | + | |
| 17 | + @project1.add_access(@user, :read, :write) | |
| 18 | + @project2.add_access(@user, :read, :write) | |
| 19 | + | |
| 20 | + @issue1 = Factory :issue, | |
| 21 | + :author => @user, | |
| 22 | + :assignee => @user, | |
| 23 | + :project => @project1 | |
| 24 | + | |
| 25 | + @issue2 = Factory :issue, | |
| 26 | + :author => @user, | |
| 27 | + :assignee => @user, | |
| 28 | + :project => @project2 | |
| 29 | + | |
| 30 | + visit dashboard_issues_path | |
| 31 | + end | |
| 32 | + | |
| 33 | + describe "atom feed", :js => false do | |
| 34 | + it "should render atom feed via private token" do | |
| 35 | + logout | |
| 36 | + visit dashboard_issues_path(:atom, :private_token => @user.private_token) | |
| 37 | + | |
| 38 | + page.response_headers['Content-Type'].should have_content("application/atom+xml") | |
| 39 | + page.body.should have_selector("title", :text => "#{@user.name} issues") | |
| 40 | + page.body.should have_selector("author email", :text => @issue1.author_email) | |
| 41 | + page.body.should have_selector("entry summary", :text => @issue1.title) | |
| 42 | + page.body.should have_selector("author email", :text => @issue2.author_email) | |
| 43 | + page.body.should have_selector("entry summary", :text => @issue2.title) | |
| 44 | + end | |
| 45 | + end | |
| 46 | + end | |
| 47 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | +require 'spec_helper' | |
| 2 | + | |
| 3 | +describe "User Dashboard" do | |
| 4 | + before { login_as :user } | |
| 5 | + | |
| 6 | + describe "GET /" do | |
| 7 | + before do | |
| 8 | + @project = Factory :project, :owner => @user | |
| 9 | + @project.add_access(@user, :read) | |
| 10 | + visit dashboard_path | |
| 11 | + end | |
| 12 | + | |
| 13 | + it "should render projects atom feed via private token" do | |
| 14 | + logout | |
| 15 | + | |
| 16 | + visit dashboard_path(:atom, :private_token => @user.private_token) | |
| 17 | + page.body.should have_selector("feed title") | |
| 18 | + end | |
| 19 | + | |
| 20 | + it "should not render projects page via private token" do | |
| 21 | + logout | |
| 22 | + | |
| 23 | + visit dashboard_path(:private_token => @user.private_token) | |
| 24 | + current_path.should == new_user_session_path | |
| 25 | + end | |
| 26 | + end | |
| 27 | +end | ... | ... |
spec/requests/commits_spec.rb
| ... | ... | @@ -1,68 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "Commits" do | |
| 4 | - let(:project) { Factory :project } | |
| 5 | - let!(:commit) { CommitDecorator.decorate(project.commit) } | |
| 6 | - before do | |
| 7 | - login_as :user | |
| 8 | - project.add_access(@user, :read) | |
| 9 | - end | |
| 10 | - | |
| 11 | - describe "GET /commits" do | |
| 12 | - before do | |
| 13 | - visit project_commits_path(project) | |
| 14 | - end | |
| 15 | - | |
| 16 | - it "should have valid path" do | |
| 17 | - current_path.should == project_commits_path(project) | |
| 18 | - end | |
| 19 | - | |
| 20 | - it "should have project name" do | |
| 21 | - page.should have_content(project.name) | |
| 22 | - end | |
| 23 | - | |
| 24 | - it "should list commits" do | |
| 25 | - page.should have_content(commit.description) | |
| 26 | - page.should have_content(commit.short_id(8)) | |
| 27 | - end | |
| 28 | - | |
| 29 | - it "should render atom feed" do | |
| 30 | - visit project_commits_path(project, :atom) | |
| 31 | - | |
| 32 | - page.response_headers['Content-Type'].should have_content("application/atom+xml") | |
| 33 | - page.body.should have_selector("title", :text => "Recent commits to #{project.name}") | |
| 34 | - page.body.should have_selector("author email", :text => commit.author_email) | |
| 35 | - page.body.should have_selector("entry summary", :text => commit.description) | |
| 36 | - end | |
| 37 | - | |
| 38 | - it "should render atom feed via private token" do | |
| 39 | - logout | |
| 40 | - visit project_commits_path(project, :atom, :private_token => @user.private_token) | |
| 41 | - | |
| 42 | - page.response_headers['Content-Type'].should have_content("application/atom+xml") | |
| 43 | - page.body.should have_selector("title", :text => "Recent commits to #{project.name}") | |
| 44 | - page.body.should have_selector("author email", :text => commit.author_email) | |
| 45 | - page.body.should have_selector("entry summary", :text => commit.description) | |
| 46 | - end | |
| 47 | - end | |
| 48 | - | |
| 49 | - describe "GET /commits/:id" do | |
| 50 | - before do | |
| 51 | - visit project_commit_path(project, commit.id) | |
| 52 | - end | |
| 53 | - | |
| 54 | - it "should have valid path" do | |
| 55 | - current_path.should == project_commit_path(project, commit.id) | |
| 56 | - end | |
| 57 | - end | |
| 58 | - | |
| 59 | - describe "GET /commits/compare" do | |
| 60 | - before do | |
| 61 | - visit compare_project_commits_path(project) | |
| 62 | - end | |
| 63 | - | |
| 64 | - it "should have valid path" do | |
| 65 | - current_path.should == compare_project_commits_path(project) | |
| 66 | - end | |
| 67 | - end | |
| 68 | -end |
spec/requests/dashboard_issues_spec.rb
| ... | ... | @@ -1,55 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "User Issues Dashboard" do | |
| 4 | - describe "GET /issues" do | |
| 5 | - before do | |
| 6 | - | |
| 7 | - login_as :user | |
| 8 | - | |
| 9 | - @project1 = Factory :project, | |
| 10 | - :path => "project1", | |
| 11 | - :code => "TEST1" | |
| 12 | - | |
| 13 | - @project2 = Factory :project, | |
| 14 | - :path => "project2", | |
| 15 | - :code => "TEST2" | |
| 16 | - | |
| 17 | - @project1.add_access(@user, :read, :write) | |
| 18 | - @project2.add_access(@user, :read, :write) | |
| 19 | - | |
| 20 | - @issue1 = Factory :issue, | |
| 21 | - :author => @user, | |
| 22 | - :assignee => @user, | |
| 23 | - :project => @project1 | |
| 24 | - | |
| 25 | - @issue2 = Factory :issue, | |
| 26 | - :author => @user, | |
| 27 | - :assignee => @user, | |
| 28 | - :project => @project2 | |
| 29 | - | |
| 30 | - visit dashboard_issues_path | |
| 31 | - end | |
| 32 | - | |
| 33 | - subject { page } | |
| 34 | - | |
| 35 | - it { should have_content(@issue1.title[0..10]) } | |
| 36 | - it { should have_content(@issue1.project.name) } | |
| 37 | - | |
| 38 | - it { should have_content(@issue2.title[0..10]) } | |
| 39 | - it { should have_content(@issue2.project.name) } | |
| 40 | - | |
| 41 | - describe "atom feed", :js => false do | |
| 42 | - it "should render atom feed via private token" do | |
| 43 | - logout | |
| 44 | - visit dashboard_issues_path(:atom, :private_token => @user.private_token) | |
| 45 | - | |
| 46 | - page.response_headers['Content-Type'].should have_content("application/atom+xml") | |
| 47 | - page.body.should have_selector("title", :text => "#{@user.name} issues") | |
| 48 | - page.body.should have_selector("author email", :text => @issue1.author_email) | |
| 49 | - page.body.should have_selector("entry summary", :text => @issue1.title) | |
| 50 | - page.body.should have_selector("author email", :text => @issue2.author_email) | |
| 51 | - page.body.should have_selector("entry summary", :text => @issue2.title) | |
| 52 | - end | |
| 53 | - end | |
| 54 | - end | |
| 55 | -end |
spec/requests/dashboard_merge_requests_spec.rb
| ... | ... | @@ -1,40 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "User MergeRequests" do | |
| 4 | - describe "GET /issues" do | |
| 5 | - before do | |
| 6 | - | |
| 7 | - login_as :user | |
| 8 | - | |
| 9 | - @project1 = Factory :project, | |
| 10 | - :path => "project1", | |
| 11 | - :code => "TEST1" | |
| 12 | - | |
| 13 | - @project2 = Factory :project, | |
| 14 | - :path => "project2", | |
| 15 | - :code => "TEST2" | |
| 16 | - | |
| 17 | - @project1.add_access(@user, :read, :write) | |
| 18 | - @project2.add_access(@user, :read, :write) | |
| 19 | - | |
| 20 | - @merge_request1 = Factory :merge_request, | |
| 21 | - :author => @user, | |
| 22 | - :assignee => @user, | |
| 23 | - :project => @project1 | |
| 24 | - | |
| 25 | - @merge_request2 = Factory :merge_request, | |
| 26 | - :author => @user, | |
| 27 | - :assignee => @user, | |
| 28 | - :project => @project2 | |
| 29 | - | |
| 30 | - visit dashboard_merge_requests_path | |
| 31 | - end | |
| 32 | - | |
| 33 | - subject { page } | |
| 34 | - | |
| 35 | - it { should have_content(@merge_request1.title[0..10]) } | |
| 36 | - it { should have_content(@merge_request1.project.name) } | |
| 37 | - it { should have_content(@merge_request2.title[0..10]) } | |
| 38 | - it { should have_content(@merge_request2.project.name) } | |
| 39 | - end | |
| 40 | -end |
spec/requests/dashboard_spec.rb
| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "User Dashboard" do | |
| 4 | - before { login_as :user } | |
| 5 | - | |
| 6 | - describe "GET /" do | |
| 7 | - before do | |
| 8 | - @project = Factory :project, :owner => @user | |
| 9 | - @project.add_access(@user, :read) | |
| 10 | - visit dashboard_path | |
| 11 | - end | |
| 12 | - | |
| 13 | - it "should be on projects page" do | |
| 14 | - current_path.should == dashboard_path | |
| 15 | - end | |
| 16 | - | |
| 17 | - it "should have link to new project" do | |
| 18 | - page.should have_content("New Project") | |
| 19 | - end | |
| 20 | - | |
| 21 | - it "should have project" do | |
| 22 | - page.should have_content(@project.name) | |
| 23 | - end | |
| 24 | - | |
| 25 | - it "should render projects atom feed via private token" do | |
| 26 | - logout | |
| 27 | - | |
| 28 | - visit dashboard_path(:atom, :private_token => @user.private_token) | |
| 29 | - page.body.should have_selector("feed title") | |
| 30 | - end | |
| 31 | - | |
| 32 | - it "should not render projects page via private token" do | |
| 33 | - logout | |
| 34 | - | |
| 35 | - visit dashboard_path(:private_token => @user.private_token) | |
| 36 | - current_path.should == new_user_session_path | |
| 37 | - end | |
| 38 | - end | |
| 39 | -end |
spec/requests/file_blame_spec.rb
| ... | ... | @@ -1,25 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "Blame file" do | |
| 4 | - before { login_as :user } | |
| 5 | - | |
| 6 | - describe "GET /:projectname/:commit/blob/Gemfile" do | |
| 7 | - before do | |
| 8 | - @project = Factory :project | |
| 9 | - @project.add_access(@user, :read) | |
| 10 | - | |
| 11 | - visit tree_project_ref_path(@project, @project.root_ref, :path => "Gemfile") | |
| 12 | - click_link "blame" | |
| 13 | - end | |
| 14 | - | |
| 15 | - it "should be correct path" do | |
| 16 | - current_path.should == blame_file_project_ref_path(@project, @project.root_ref, :path => "Gemfile") | |
| 17 | - end | |
| 18 | - | |
| 19 | - it "should contain file view" do | |
| 20 | - page.should have_content("rubygems.org") | |
| 21 | - page.should have_content("Dmitriy Zaporozhets") | |
| 22 | - page.should have_content("bc3735004cb Moving to rails 3.2") | |
| 23 | - end | |
| 24 | - end | |
| 25 | -end |
spec/requests/keys_spec.rb
| ... | ... | @@ -1,65 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "Issues" do | |
| 4 | - before do | |
| 5 | - login_as :user | |
| 6 | - end | |
| 7 | - | |
| 8 | - describe "GET /keys" do | |
| 9 | - before do | |
| 10 | - @key = Factory :key, :user => @user | |
| 11 | - visit keys_path | |
| 12 | - end | |
| 13 | - | |
| 14 | - subject { page } | |
| 15 | - | |
| 16 | - it { should have_content(@key.title) } | |
| 17 | - | |
| 18 | - describe "Destroy" do | |
| 19 | - before { visit key_path(@key) } | |
| 20 | - | |
| 21 | - it "should remove entry" do | |
| 22 | - expect { | |
| 23 | - click_link "Remove" | |
| 24 | - }.to change { @user.keys.count }.by(-1) | |
| 25 | - end | |
| 26 | - end | |
| 27 | - end | |
| 28 | - | |
| 29 | - describe "New key" do | |
| 30 | - before do | |
| 31 | - visit keys_path | |
| 32 | - click_link "Add new" | |
| 33 | - end | |
| 34 | - | |
| 35 | - it "should open new key popup" do | |
| 36 | - page.should have_content("New key") | |
| 37 | - end | |
| 38 | - | |
| 39 | - describe "fill in" do | |
| 40 | - before do | |
| 41 | - fill_in "key_title", :with => "laptop" | |
| 42 | - fill_in "key_key", :with => "publickey234=" | |
| 43 | - end | |
| 44 | - | |
| 45 | - it { expect { click_button "Save" }.to change {Key.count}.by(1) } | |
| 46 | - | |
| 47 | - it "should add new key to table" do | |
| 48 | - click_button "Save" | |
| 49 | - | |
| 50 | - page.should_not have_content("New key") | |
| 51 | - page.should have_content "laptop" | |
| 52 | - end | |
| 53 | - end | |
| 54 | - end | |
| 55 | - | |
| 56 | - describe "Show page" do | |
| 57 | - before do | |
| 58 | - @key = Factory :key, :user => @user | |
| 59 | - visit key_path(@key) | |
| 60 | - end | |
| 61 | - | |
| 62 | - it { page.should have_content @key.title } | |
| 63 | - it { page.should have_content @key.key[0..10] } | |
| 64 | - end | |
| 65 | -end |
spec/requests/last_push_widget_spec.rb
| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "Last Push widget" do | |
| 4 | - before { login_as :user } | |
| 5 | - | |
| 6 | - before do | |
| 7 | - @project = Factory :project, :owner => @user | |
| 8 | - @project.add_access(@user, :read) | |
| 9 | - create_push_event | |
| 10 | - visit dashboard_path | |
| 11 | - end | |
| 12 | - | |
| 13 | - it "should display last push widget with link to merge request page" do | |
| 14 | - page.should have_content "Your pushed to branch new_design" | |
| 15 | - page.should have_link "Create Merge Request" | |
| 16 | - end | |
| 17 | - | |
| 18 | - describe "click create MR" do | |
| 19 | - before { click_link "Create Merge Request" } | |
| 20 | - | |
| 21 | - it { current_path.should == new_project_merge_request_path(@project) } | |
| 22 | - it { find("#merge_request_source_branch").value.should == "new_design" } | |
| 23 | - it { find("#merge_request_target_branch").value.should == "master" } | |
| 24 | - it { find("#merge_request_title").value.should == "New Design" } | |
| 25 | - end | |
| 26 | - | |
| 27 | - | |
| 28 | - def create_push_event | |
| 29 | - data = { | |
| 30 | - :before => "0000000000000000000000000000000000000000", | |
| 31 | - :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", | |
| 32 | - :ref => "refs/heads/new_design", | |
| 33 | - :user_id => @user.id, | |
| 34 | - :user_name => @user.name, | |
| 35 | - :repository => { | |
| 36 | - :name => @project.name, | |
| 37 | - :url => "localhost/rubinius", | |
| 38 | - :description => "", | |
| 39 | - :homepage => "localhost/rubinius", | |
| 40 | - :private => true | |
| 41 | - } | |
| 42 | - } | |
| 43 | - | |
| 44 | - @event = Event.create( | |
| 45 | - :project => @project, | |
| 46 | - :action => Event::Pushed, | |
| 47 | - :data => data, | |
| 48 | - :author_id => @user.id | |
| 49 | - ) | |
| 50 | - end | |
| 51 | -end | |
| 52 | - |
spec/requests/profile_spec.rb
| ... | ... | @@ -1,82 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "Profile" do | |
| 4 | - before do | |
| 5 | - login_as :user | |
| 6 | - end | |
| 7 | - | |
| 8 | - describe "Show profile" do | |
| 9 | - before do | |
| 10 | - visit profile_path | |
| 11 | - end | |
| 12 | - | |
| 13 | - it { page.should have_content(@user.name) } | |
| 14 | - end | |
| 15 | - | |
| 16 | - describe "Profile update" do | |
| 17 | - before do | |
| 18 | - visit profile_path | |
| 19 | - fill_in "user_skype", :with => "testskype" | |
| 20 | - fill_in "user_linkedin", :with => "testlinkedin" | |
| 21 | - fill_in "user_twitter", :with => "testtwitter" | |
| 22 | - click_button "Save" | |
| 23 | - @user.reload | |
| 24 | - end | |
| 25 | - | |
| 26 | - it { @user.skype.should == 'testskype' } | |
| 27 | - it { @user.linkedin.should == 'testlinkedin' } | |
| 28 | - it { @user.twitter.should == 'testtwitter' } | |
| 29 | - end | |
| 30 | - | |
| 31 | - describe "Reset private token" do | |
| 32 | - before do | |
| 33 | - visit profile_token_path | |
| 34 | - end | |
| 35 | - | |
| 36 | - it "should reset private token" do | |
| 37 | - user_first_token = @user.private_token | |
| 38 | - click_button "Reset" | |
| 39 | - @user.reload | |
| 40 | - @user.private_token.should_not == user_first_token | |
| 41 | - end | |
| 42 | - end | |
| 43 | - | |
| 44 | - describe "Password update" do | |
| 45 | - before do | |
| 46 | - visit profile_password_path | |
| 47 | - end | |
| 48 | - | |
| 49 | - it { page.should have_content("Password") } | |
| 50 | - it { page.should have_content("Password confirmation") } | |
| 51 | - | |
| 52 | - describe "change password" do | |
| 53 | - before do | |
| 54 | - @old_pwd = @user.encrypted_password | |
| 55 | - fill_in "user_password", :with => "777777" | |
| 56 | - fill_in "user_password_confirmation", :with => "777777" | |
| 57 | - click_button "Save" | |
| 58 | - @user.reload | |
| 59 | - end | |
| 60 | - | |
| 61 | - it "should redirect to signin page" do | |
| 62 | - current_path.should == new_user_session_path | |
| 63 | - end | |
| 64 | - | |
| 65 | - it "should change password" do | |
| 66 | - @user.encrypted_password.should_not == @old_pwd | |
| 67 | - end | |
| 68 | - | |
| 69 | - describe "login with new password" do | |
| 70 | - before do | |
| 71 | - fill_in "user_email", :with => @user.email | |
| 72 | - fill_in "user_password", :with => "777777" | |
| 73 | - click_button "Sign in" | |
| 74 | - end | |
| 75 | - | |
| 76 | - it "should login user" do | |
| 77 | - current_path.should == root_path | |
| 78 | - end | |
| 79 | - end | |
| 80 | - end | |
| 81 | - end | |
| 82 | -end |
spec/requests/projects_spec.rb
| ... | ... | @@ -3,47 +3,6 @@ require 'spec_helper' |
| 3 | 3 | describe "Projects" do |
| 4 | 4 | before { login_as :user } |
| 5 | 5 | |
| 6 | - describe "GET /projects/new" do | |
| 7 | - before do | |
| 8 | - visit root_path | |
| 9 | - click_link "New Project" | |
| 10 | - end | |
| 11 | - | |
| 12 | - it "should be correct path" do | |
| 13 | - current_path.should == new_project_path | |
| 14 | - end | |
| 15 | - | |
| 16 | - it "should have labels for new project" do | |
| 17 | - page.should have_content("Project name is") | |
| 18 | - end | |
| 19 | - end | |
| 20 | - | |
| 21 | - describe "POST /projects" do | |
| 22 | - before do | |
| 23 | - visit new_project_path | |
| 24 | - fill_in 'project_name', :with => 'NewProject' | |
| 25 | - fill_in 'project_code', :with => 'NPR' | |
| 26 | - fill_in 'project_path', :with => 'newproject' | |
| 27 | - expect { click_button "Create project" }.to change { Project.count }.by(1) | |
| 28 | - @project = Project.last | |
| 29 | - end | |
| 30 | - | |
| 31 | - it "should be correct path" do | |
| 32 | - current_path.should == project_path(@project) | |
| 33 | - end | |
| 34 | - | |
| 35 | - it "should show project" do | |
| 36 | - page.should have_content(@project.name) | |
| 37 | - page.should have_content(@project.path) | |
| 38 | - page.should have_content(@project.description) | |
| 39 | - end | |
| 40 | - | |
| 41 | - it "should init repo instructions" do | |
| 42 | - page.should have_content("git remote") | |
| 43 | - page.should have_content(@project.url_to_repo) | |
| 44 | - end | |
| 45 | - end | |
| 46 | - | |
| 47 | 6 | describe "GET /projects/show" do |
| 48 | 7 | before do |
| 49 | 8 | @project = Factory :project, :owner => @user |
| ... | ... | @@ -57,42 +16,6 @@ describe "Projects" do |
| 57 | 16 | end |
| 58 | 17 | end |
| 59 | 18 | |
| 60 | - describe "GET /projects/graph" do | |
| 61 | - before do | |
| 62 | - @project = Factory :project | |
| 63 | - @project.add_access(@user, :read) | |
| 64 | - | |
| 65 | - visit graph_project_path(@project) | |
| 66 | - end | |
| 67 | - | |
| 68 | - it "should be correct path" do | |
| 69 | - current_path.should == graph_project_path(@project) | |
| 70 | - end | |
| 71 | - | |
| 72 | - it "should have as as team member" do | |
| 73 | - page.should have_content("master") | |
| 74 | - end | |
| 75 | - end | |
| 76 | - | |
| 77 | - describe "GET /projects/team" do | |
| 78 | - before do | |
| 79 | - @project = Factory :project | |
| 80 | - @project.add_access(@user, :read) | |
| 81 | - | |
| 82 | - visit team_project_path(@project, | |
| 83 | - :path => ValidCommit::BLOB_FILE_PATH, | |
| 84 | - :commit_id => ValidCommit::ID) | |
| 85 | - end | |
| 86 | - | |
| 87 | - it "should be correct path" do | |
| 88 | - current_path.should == team_project_path(@project) | |
| 89 | - end | |
| 90 | - | |
| 91 | - it "should have as as team member" do | |
| 92 | - page.should have_content(@user.name) | |
| 93 | - end | |
| 94 | - end | |
| 95 | - | |
| 96 | 19 | describe "GET /projects/:id/edit" do |
| 97 | 20 | before do |
| 98 | 21 | @project = Factory :project | ... | ... |
spec/requests/projects_tree_spec.rb
| ... | ... | @@ -1,90 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "Projects" do | |
| 4 | - before { login_as :user } | |
| 5 | - | |
| 6 | - describe "GET /projects/tree" do | |
| 7 | - describe "head" do | |
| 8 | - before do | |
| 9 | - @project = Factory :project | |
| 10 | - @project.add_access(@user, :read) | |
| 11 | - | |
| 12 | - visit tree_project_ref_path(@project, @project.root_ref) | |
| 13 | - end | |
| 14 | - | |
| 15 | - it "should be correct path" do | |
| 16 | - current_path.should == tree_project_ref_path(@project, @project.root_ref) | |
| 17 | - end | |
| 18 | - | |
| 19 | - it_behaves_like :tree_view | |
| 20 | - end | |
| 21 | - | |
| 22 | - describe ValidCommit::ID do | |
| 23 | - before do | |
| 24 | - @project = Factory :project | |
| 25 | - @project.add_access(@user, :read) | |
| 26 | - | |
| 27 | - visit tree_project_ref_path(@project, ValidCommit::ID) | |
| 28 | - end | |
| 29 | - | |
| 30 | - it "should be correct path" do | |
| 31 | - current_path.should == tree_project_ref_path(@project, ValidCommit::ID) | |
| 32 | - end | |
| 33 | - | |
| 34 | - it_behaves_like :tree_view | |
| 35 | - it_behaves_like :project_side_pane | |
| 36 | - end | |
| 37 | - | |
| 38 | - describe "branch passed" do | |
| 39 | - before do | |
| 40 | - @project = Factory :project | |
| 41 | - @project.add_access(@user, :read) | |
| 42 | - | |
| 43 | - visit tree_project_ref_path(@project, @project.root_ref) | |
| 44 | - end | |
| 45 | - | |
| 46 | - it "should be correct path" do | |
| 47 | - current_path.should == tree_project_ref_path(@project, @project.root_ref) | |
| 48 | - end | |
| 49 | - | |
| 50 | - it_behaves_like :tree_view | |
| 51 | - it_behaves_like :project_side_pane | |
| 52 | - end | |
| 53 | - | |
| 54 | - # TREE FILE PREVIEW | |
| 55 | - describe "file preview" do | |
| 56 | - before do | |
| 57 | - @project = Factory :project | |
| 58 | - @project.add_access(@user, :read) | |
| 59 | - | |
| 60 | - visit tree_project_ref_path(@project, @project.root_ref, :path => "Gemfile") | |
| 61 | - end | |
| 62 | - | |
| 63 | - it "should be correct path" do | |
| 64 | - current_path.should == tree_project_ref_path(@project, @project.root_ref) | |
| 65 | - end | |
| 66 | - | |
| 67 | - it "should contain file view" do | |
| 68 | - page.should have_content("rubygems.org") | |
| 69 | - end | |
| 70 | - end | |
| 71 | - end | |
| 72 | - | |
| 73 | - # RAW FILE | |
| 74 | - describe "GET /projects/blob" do | |
| 75 | - before do | |
| 76 | - @project = Factory :project | |
| 77 | - @project.add_access(@user, :read) | |
| 78 | - | |
| 79 | - visit blob_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH) | |
| 80 | - end | |
| 81 | - | |
| 82 | - it "should be correct path" do | |
| 83 | - current_path.should == blob_project_ref_path(@project, ValidCommit::ID) | |
| 84 | - end | |
| 85 | - | |
| 86 | - it "raw file response" do | |
| 87 | - page.source.should == ValidCommit::BLOB_FILE | |
| 88 | - end | |
| 89 | - end | |
| 90 | -end |
spec/requests/projects_wall_spec.rb
| ... | ... | @@ -1,33 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "Projects", "Wall" do | |
| 4 | - let(:project) { Factory :project } | |
| 5 | - | |
| 6 | - before do | |
| 7 | - login_as :user | |
| 8 | - project.add_access(@user, :read, :write) | |
| 9 | - end | |
| 10 | - | |
| 11 | - describe "View notes on wall", :js => true do | |
| 12 | - before do | |
| 13 | - Factory :note, :project => project, :note => "Project specs", :author => @user | |
| 14 | - visit wall_project_path(project) | |
| 15 | - end | |
| 16 | - | |
| 17 | - it { page.should have_content("Project specs") } | |
| 18 | - it { page.should have_content(@user.name) } | |
| 19 | - it { page.should have_content("less than a minute ago") } | |
| 20 | - end | |
| 21 | - | |
| 22 | - describe "add new note", :js => true do | |
| 23 | - before do | |
| 24 | - visit wall_project_path(project) | |
| 25 | - fill_in "note_note", :with => "my post on wall" | |
| 26 | - click_button "Add Comment" | |
| 27 | - end | |
| 28 | - | |
| 29 | - it "should conatin new note" do | |
| 30 | - page.should have_content("my post on wall") | |
| 31 | - end | |
| 32 | - end | |
| 33 | -end |
spec/requests/wikis_spec.rb
| ... | ... | @@ -1,35 +0,0 @@ |
| 1 | -require 'spec_helper' | |
| 2 | - | |
| 3 | -describe "Wiki" do | |
| 4 | - let(:project) { Factory :project } | |
| 5 | - | |
| 6 | - before do | |
| 7 | - login_as :user | |
| 8 | - project.add_access(@user, :read, :write) | |
| 9 | - end | |
| 10 | - | |
| 11 | - describe "Add pages" do | |
| 12 | - before do | |
| 13 | - visit project_wiki_path(project, :index) | |
| 14 | - end | |
| 15 | - | |
| 16 | - it "should see form" do | |
| 17 | - page.should have_content("Editing page") | |
| 18 | - end | |
| 19 | - | |
| 20 | - it "should see added page" do | |
| 21 | - fill_in "Title", :with => 'Test title' | |
| 22 | - fill_in "Content", :with => '[link test](test)' | |
| 23 | - click_on "Save" | |
| 24 | - | |
| 25 | - page.should have_content("Test title") | |
| 26 | - page.should have_content("link test") | |
| 27 | - | |
| 28 | - click_link "link test" | |
| 29 | - | |
| 30 | - page.should have_content("Editing page") | |
| 31 | - end | |
| 32 | - | |
| 33 | - end | |
| 34 | - | |
| 35 | -end |