summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2014-12-07 20:25:58 -0700
committerVinnie Okada <vokada@mrvinn.com>2014-12-07 20:25:58 -0700
commit742e6eeed221489d5f35bdfde2e6ce55db75d25f (patch)
tree710c01fbd18e81a7590819161434e19855e35a97 /spec/features
parent7a5072c5a8f03cd7342a5f8e74e1fde0250ce360 (diff)
parentbbf9953b99d59801c72dd7b9550ee149ca77bfcf (diff)
downloadgitlab-ce-742e6eeed221489d5f35bdfde2e6ce55db75d25f.tar.gz
Merge branch 'upstream-master' into markdown-preview
Conflicts: spec/routing/project_routing_spec.rb
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/atom/users_spec.rb43
-rw-r--r--spec/features/projects_spec.rb25
-rw-r--r--spec/features/users_spec.rb2
3 files changed, 62 insertions, 8 deletions
diff --git a/spec/features/atom/users_spec.rb b/spec/features/atom/users_spec.rb
new file mode 100644
index 00000000000..746b6fc1ac9
--- /dev/null
+++ b/spec/features/atom/users_spec.rb
@@ -0,0 +1,43 @@
+require 'spec_helper'
+
+describe "User Feed", feature: true do
+ describe "GET /" do
+ let!(:user) { create(:user) }
+
+ context "user atom feed via private token" do
+ it "should render user atom feed" do
+ visit user_path(user, :atom, private_token: user.private_token)
+ body.should have_selector("feed title")
+ end
+ end
+
+ context 'feed content' do
+ let(:project) { create(:project) }
+ let(:issue) { create(:issue, project: project, author: user, description: '') }
+ let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) }
+
+ before do
+ project.team << [user, :master]
+ issue_event(issue, user)
+ note_event(note, user)
+ visit user_path(user, :atom, private_token: user.private_token)
+ end
+
+ it "should have issue opened event" do
+ body.should have_content("#{user.name} opened issue ##{issue.iid}")
+ end
+
+ it "should have issue comment event" do
+ body.should have_content("#{user.name} commented on issue ##{issue.iid}")
+ end
+ end
+ end
+
+ def issue_event(issue, user)
+ EventCreateService.new.open_issue(issue, user)
+ end
+
+ def note_event(note, user)
+ EventCreateService.new.leave_note(note, user)
+ end
+end
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb
index 98ba5a47ee5..d291621935b 100644
--- a/spec/features/projects_spec.rb
+++ b/spec/features/projects_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe "Projects", feature: true do
+describe "Projects", feature: true, js: true do
before { login_as :user }
describe "DELETE /projects/:id" do
@@ -10,12 +10,23 @@ describe "Projects", feature: true do
visit edit_project_path(@project)
end
- it "should be correct path", js: true do
- expect {
- click_link "Remove project"
- fill_in 'confirm_name_input', with: @project.path
- click_button 'Confirm'
- }.to change {Project.count}.by(-1)
+ it "should remove project" do
+ expect { remove_project }.to change {Project.count}.by(-1)
end
+
+ it 'should delete the project from disk' do
+ expect(GitlabShellWorker).to(
+ receive(:perform_async).with(:remove_repository,
+ /#{@project.path_with_namespace}/)
+ ).twice
+
+ remove_project
+ end
+ end
+
+ def remove_project
+ click_link "Remove project"
+ fill_in 'confirm_name_input', with: @project.path
+ click_button 'Confirm'
end
end
diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb
index 7b831c48611..a1206989d39 100644
--- a/spec/features/users_spec.rb
+++ b/spec/features/users_spec.rb
@@ -11,7 +11,7 @@ describe 'Users', feature: true do
fill_in "user_name", with: "Name Surname"
fill_in "user_username", with: "Great"
fill_in "user_email", with: "name@mail.com"
- fill_in "user_password", with: "password1234"
+ fill_in "user_password_sign_up", with: "password1234"
fill_in "user_password_confirmation", with: "password1234"
expect { click_button "Sign up" }.to change {User.count}.by(1)
end