From 6de488259701af4b69282ad105882dba423fb666 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 3 Aug 2012 19:29:54 +0300 Subject: [PATCH] Remove duplicate coverage in spec requests. All features should be covered in cucumber --- features/dashboard/dashboard.feature | 2 +- features/profile/profile.feature | 6 +++++- features/projects/source/browse_files.feature | 23 +++++++++++++++++++++++ features/projects/source/browse_files.feature.commented | 23 ----------------------- features/projects/source/git_blame.feature | 10 ++++++++++ features/step_definitions/browse_code_steps.rb | 10 ++++++++++ features/step_definitions/profile_steps.rb | 13 +++++++++++++ spec/requests/atom/dashboard_issues_spec.rb | 47 +++++++++++++++++++++++++++++++++++++++++++++++ spec/requests/atom/dashboard_spec.rb | 27 +++++++++++++++++++++++++++ spec/requests/commits_spec.rb | 68 -------------------------------------------------------------------- spec/requests/dashboard_issues_spec.rb | 55 ------------------------------------------------------- spec/requests/dashboard_merge_requests_spec.rb | 40 ---------------------------------------- spec/requests/dashboard_spec.rb | 39 --------------------------------------- spec/requests/file_blame_spec.rb | 25 ------------------------- spec/requests/keys_spec.rb | 65 ----------------------------------------------------------------- spec/requests/last_push_widget_spec.rb | 52 ---------------------------------------------------- spec/requests/profile_spec.rb | 82 ---------------------------------------------------------------------------------- spec/requests/projects_spec.rb | 77 ----------------------------------------------------------------------------- spec/requests/projects_tree_spec.rb | 90 ------------------------------------------------------------------------------------------ spec/requests/projects_wall_spec.rb | 33 --------------------------------- spec/requests/wikis_spec.rb | 35 ----------------------------------- 21 files changed, 136 insertions(+), 686 deletions(-) create mode 100644 features/projects/source/browse_files.feature delete mode 100644 features/projects/source/browse_files.feature.commented create mode 100644 spec/requests/atom/dashboard_issues_spec.rb create mode 100644 spec/requests/atom/dashboard_spec.rb delete mode 100644 spec/requests/commits_spec.rb delete mode 100644 spec/requests/dashboard_issues_spec.rb delete mode 100644 spec/requests/dashboard_merge_requests_spec.rb delete mode 100644 spec/requests/dashboard_spec.rb delete mode 100644 spec/requests/file_blame_spec.rb delete mode 100644 spec/requests/keys_spec.rb delete mode 100644 spec/requests/last_push_widget_spec.rb delete mode 100644 spec/requests/profile_spec.rb delete mode 100644 spec/requests/projects_tree_spec.rb delete mode 100644 spec/requests/projects_wall_spec.rb delete mode 100644 spec/requests/wikis_spec.rb diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature index 2d66af5..a8c2205 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 e3d71ab..afda4b5 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 b/features/projects/source/browse_files.feature new file mode 100644 index 0000000..04aebc1 --- /dev/null +++ b/features/projects/source/browse_files.feature @@ -0,0 +1,23 @@ +Feature: Browse git repo + Background: + Given I signin as a user + And I own project "Shop" + Given I visit project source page + + Scenario: I browse files from master branch + Then I should see files from repository + + Scenario: I browse files for specific ref + Given I visit project source page for "8470d70" + Then I should see files from repository for "8470d70" + + Scenario: I browse file content + Given I click on file from repo + Then I should see it content + + Scenario: I browse raw file + Given I visit blob file from repo + And I click on raw button + Then I should see raw file content + + diff --git a/features/projects/source/browse_files.feature.commented b/features/projects/source/browse_files.feature.commented deleted file mode 100644 index 04aebc1..0000000 --- a/features/projects/source/browse_files.feature.commented +++ /dev/null @@ -1,23 +0,0 @@ -Feature: Browse git repo - Background: - Given I signin as a user - And I own project "Shop" - Given I visit project source page - - Scenario: I browse files from master branch - Then I should see files from repository - - Scenario: I browse files for specific ref - Given I visit project source page for "8470d70" - Then I should see files from repository for "8470d70" - - Scenario: I browse file content - Given I click on file from repo - Then I should see it content - - Scenario: I browse raw file - Given I visit blob file from repo - And I click on raw button - Then I should see raw file content - - diff --git a/features/projects/source/git_blame.feature b/features/projects/source/git_blame.feature index e69de29..6aa6be4 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 fc3cf56..7f9001b 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 7510c53..4661139 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/atom/dashboard_issues_spec.rb b/spec/requests/atom/dashboard_issues_spec.rb new file mode 100644 index 0000000..7260dcf --- /dev/null +++ b/spec/requests/atom/dashboard_issues_spec.rb @@ -0,0 +1,47 @@ +require 'spec_helper' + +describe "User Issues Dashboard" 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) + + @issue1 = Factory :issue, + :author => @user, + :assignee => @user, + :project => @project1 + + @issue2 = Factory :issue, + :author => @user, + :assignee => @user, + :project => @project2 + + visit dashboard_issues_path + end + + describe "atom feed", :js => false do + it "should render atom feed via private token" do + logout + visit dashboard_issues_path(:atom, :private_token => @user.private_token) + + page.response_headers['Content-Type'].should have_content("application/atom+xml") + page.body.should have_selector("title", :text => "#{@user.name} issues") + page.body.should have_selector("author email", :text => @issue1.author_email) + page.body.should have_selector("entry summary", :text => @issue1.title) + page.body.should have_selector("author email", :text => @issue2.author_email) + page.body.should have_selector("entry summary", :text => @issue2.title) + end + end + end +end diff --git a/spec/requests/atom/dashboard_spec.rb b/spec/requests/atom/dashboard_spec.rb new file mode 100644 index 0000000..4db8ce4 --- /dev/null +++ b/spec/requests/atom/dashboard_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe "User Dashboard" do + before { login_as :user } + + describe "GET /" do + before do + @project = Factory :project, :owner => @user + @project.add_access(@user, :read) + visit dashboard_path + end + + it "should render projects atom feed via private token" do + logout + + visit dashboard_path(:atom, :private_token => @user.private_token) + page.body.should have_selector("feed title") + end + + it "should not render projects page via private token" do + logout + + visit dashboard_path(:private_token => @user.private_token) + current_path.should == new_user_session_path + end + end +end diff --git a/spec/requests/commits_spec.rb b/spec/requests/commits_spec.rb deleted file mode 100644 index ae36a93..0000000 --- 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_issues_spec.rb b/spec/requests/dashboard_issues_spec.rb deleted file mode 100644 index 29c7931..0000000 --- a/spec/requests/dashboard_issues_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -require 'spec_helper' - -describe "User Issues Dashboard" 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) - - @issue1 = Factory :issue, - :author => @user, - :assignee => @user, - :project => @project1 - - @issue2 = Factory :issue, - :author => @user, - :assignee => @user, - :project => @project2 - - 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 - visit dashboard_issues_path(:atom, :private_token => @user.private_token) - - page.response_headers['Content-Type'].should have_content("application/atom+xml") - page.body.should have_selector("title", :text => "#{@user.name} issues") - page.body.should have_selector("author email", :text => @issue1.author_email) - page.body.should have_selector("entry summary", :text => @issue1.title) - page.body.should have_selector("author email", :text => @issue2.author_email) - page.body.should have_selector("entry summary", :text => @issue2.title) - end - 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 f345a85..0000000 --- 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/dashboard_spec.rb b/spec/requests/dashboard_spec.rb deleted file mode 100644 index 16ededd..0000000 --- a/spec/requests/dashboard_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -require 'spec_helper' - -describe "User Dashboard" do - before { login_as :user } - - describe "GET /" do - before do - @project = Factory :project, :owner => @user - @project.add_access(@user, :read) - 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 - - visit dashboard_path(:atom, :private_token => @user.private_token) - page.body.should have_selector("feed title") - end - - it "should not render projects page via private token" do - logout - - visit dashboard_path(:private_token => @user.private_token) - current_path.should == new_user_session_path - end - end -end diff --git a/spec/requests/file_blame_spec.rb b/spec/requests/file_blame_spec.rb deleted file mode 100644 index 511f340..0000000 --- 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 2bc7c75..0000000 --- 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 0baa20c..0000000 --- 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 6f9af60..0000000 --- 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 c9c3484..f96affc 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 acc4f0b..0000000 --- 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 b2708fd..0000000 --- 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 fd66b5e..0000000 --- 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 -- libgit2 0.21.2