Commit d593c98f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Delete wall notes tests

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 1355ede4
......@@ -35,11 +35,6 @@ Feature: Project active tab
Then the active main tab should be Merge Requests
And no other main tabs should be active
Scenario: On Project Wall
Given I visit my project's wall page
Then the active main tab should be Wall
And no other main tabs should be active
Scenario: On Project Wiki
Given I visit my project's wiki page
Then the active main tab should be Wiki
......
Feature: Project Wall
In order to use Project Wall
A user should be able to read and write messages
Background:
Given I sign in as a user
And I own project "Shop"
And I visit project "Shop" wall page
@javascript
Scenario: Write comment
Given I write new comment "my special test message"
Then I should see project wall note "my special test message"
Then I visit project "Shop" wall page
And I should see project wall note "my special test message"
class ProjectWall < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedNote
include SharedPaths
Given 'I write new comment "my special test message"' do
within(".wall-note-form") do
fill_in "note[note]", with: "my special test message"
click_button "Add Comment"
end
end
Then 'I should see project wall note "my special test message"' do
page.should have_content "my special test message"
end
end
......@@ -204,10 +204,6 @@ module SharedPaths
visit project_merge_requests_path(@project)
end
step "I visit my project's wall page" do
visit project_wall_path(@project)
end
step "I visit my project's wiki page" do
visit project_wiki_path(@project, :home)
end
......@@ -319,10 +315,6 @@ module SharedPaths
visit project_team_index_path(project)
end
step 'I visit project "Shop" wall page' do
visit project_wall_path(project)
end
step 'I visit project wiki page' do
visit project_wiki_path(@project, :home)
end
......
......@@ -87,17 +87,6 @@ describe "Internal Project Access", feature: true do
it { should be_denied_for :visitor }
end
describe "GET /:project_path/wall" do
subject { project_wall_path(project) }
it { should be_allowed_for master }
it { should be_allowed_for reporter }
it { should be_allowed_for :admin }
it { should be_allowed_for guest }
it { should be_allowed_for :user }
it { should be_denied_for :visitor }
end
describe "GET /:project_path/blob" do
before do
commit = project.repository.commit
......
......@@ -87,17 +87,6 @@ describe "Private Project Access", feature: true do
it { should be_denied_for :visitor }
end
describe "GET /:project_path/wall" do
subject { project_wall_path(project) }
it { should be_allowed_for master }
it { should be_allowed_for reporter }
it { should be_allowed_for :admin }
it { should be_denied_for guest }
it { should be_denied_for :user }
it { should be_denied_for :visitor }
end
describe "GET /:project_path/blob" do
before do
commit = project.repository.commit
......
......@@ -92,17 +92,6 @@ describe "Public Project Access", feature: true do
it { should be_denied_for :visitor }
end
describe "GET /:project_path/wall" do
subject { project_wall_path(project) }
it { should be_allowed_for master }
it { should be_allowed_for reporter }
it { should be_allowed_for :admin }
it { should be_allowed_for guest }
it { should be_allowed_for :user }
it { should be_allowed_for :visitor }
end
describe "GET /:project_path/blob" do
before do
commit = project.repository.commit
......
......@@ -410,22 +410,6 @@ describe Notify do
end
end
describe 'on a project wall' do
let(:note_on_the_wall_path) { project_wall_path(project, anchor: "note_#{note.id}") }
subject { Notify.note_wall_email(recipient.id, note.id) }
it_behaves_like 'a note email'
it 'has the correct subject' do
should have_subject /#{project.name}/
end
it 'contains a link to the wall note' do
should have_body_text /#{note_on_the_wall_path}/
end
end
describe 'on a commit' do
let(:commit) { project.repository.commit }
......
......@@ -13,58 +13,8 @@ describe API::API, api: true do
let!(:issue_note) { create(:note, noteable: issue, project: project, author: user) }
let!(:merge_request_note) { create(:note, noteable: merge_request, project: project, author: user) }
let!(:snippet_note) { create(:note, noteable: snippet, project: project, author: user) }
let!(:wall_note) { create(:note, project: project, author: user) }
before { project.team << [user, :reporter] }
describe "GET /projects/:id/notes" do
context "when unauthenticated" do
it "should return authentication error" do
get api("/projects/#{project.id}/notes")
response.status.should == 401
end
end
context "when authenticated" do
it "should return project wall notes" do
get api("/projects/#{project.id}/notes", user)
response.status.should == 200
json_response.should be_an Array
json_response.first['body'].should == wall_note.note
end
end
end
describe "GET /projects/:id/notes/:note_id" do
it "should return a wall note by id" do
get api("/projects/#{project.id}/notes/#{wall_note.id}", user)
response.status.should == 200
json_response['body'].should == wall_note.note
end
it "should return a 404 error if note not found" do
get api("/projects/#{project.id}/notes/123", user)
response.status.should == 404
end
end
describe "POST /projects/:id/notes" do
it "should create a new wall note" do
post api("/projects/#{project.id}/notes", user), body: 'hi!'
response.status.should == 201
json_response['body'].should == 'hi!'
end
it "should return 401 unauthorized error" do
post api("/projects/#{project.id}/notes")
response.status.should == 401
end
it "should return a 400 bad request if body is missing" do
post api("/projects/#{project.id}/notes", user)
response.status.should == 400
end
end
describe "GET /projects/:id/noteable/:noteable_id/notes" do
context "when noteable is an Issue" do
it "should return an array of issue notes" do
......
......@@ -126,7 +126,6 @@ describe API::API, api: true do
project = attributes_for(:project, {
description: Faker::Lorem.sentence,
issues_enabled: false,
wall_enabled: false,
merge_requests_enabled: false,
wiki_enabled: false
})
......@@ -208,7 +207,6 @@ describe API::API, api: true do
project = attributes_for(:project, {
description: Faker::Lorem.sentence,
issues_enabled: false,
wall_enabled: false,
merge_requests_enabled: false,
wiki_enabled: false
})
......
......@@ -56,7 +56,6 @@ end
# projects POST /projects(.:format) projects#create
# new_project GET /projects/new(.:format) projects#new
# fork_project POST /:id/fork(.:format) projects#fork
# wall_project GET /:id/wall(.:format) projects#wall
# files_project GET /:id/files(.:format) projects#files
# edit_project GET /:id/edit(.:format) projects#edit
# project GET /:id(.:format) projects#show
......@@ -75,10 +74,6 @@ describe ProjectsController, "routing" do
post("/gitlab/gitlabhq/fork").should route_to('projects#fork', id: 'gitlab/gitlabhq')
end
it "to #wall" do
get("/gitlab/gitlabhq/wall").should route_to('projects/walls#show', project_id: 'gitlab/gitlabhq')
end
it "to #edit" do
get("/gitlab/gitlabhq/edit").should route_to('projects#edit', id: 'gitlab/gitlabhq')
end
......
......@@ -65,7 +65,6 @@ describe Projects::CreateService do
@settings.stub(:issues) { true }
@settings.stub(:merge_requests) { true }
@settings.stub(:wiki) { true }
@settings.stub(:wall) { true }
@settings.stub(:snippets) { true }
stub_const("Settings", Class.new)
@restrictions = double("restrictions")
......@@ -108,7 +107,6 @@ describe Projects::CreateService do
@settings.stub(:issues) { true }
@settings.stub(:merge_requests) { true }
@settings.stub(:wiki) { true }
@settings.stub(:wall) { true }
@settings.stub(:snippets) { true }
@settings.stub(:visibility_level) { Gitlab::VisibilityLevel::PRIVATE }
stub_const("Settings", Class.new)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment