summaryrefslogtreecommitdiff
path: root/spec/requests/api/internal_spec.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-03-07 19:34:43 +0100
committerRémy Coutable <remy@rymai.me>2017-04-14 15:20:55 +0200
commitcfe19b795e076b73df75ee57839640667283651c (patch)
treee5de8f36de866a24a9e1068063a115640062e801 /spec/requests/api/internal_spec.rb
parent91ac0e038ab51dd2f30f2bb7c91837fa588ca250 (diff)
downloadgitlab-ce-cfe19b795e076b73df75ee57839640667283651c.tar.gz
Add a new Gitlab::UserActivities class to track user activities
This new class uses a Redis Hash instead of a Sorted Set. Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/requests/api/internal_spec.rb')
-rw-r--r--spec/requests/api/internal_spec.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index eee8bd51bff..3d6010ede73 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -148,8 +148,6 @@ describe API::Internal, api: true do
end
describe "POST /internal/allowed", :redis do
- include UserActivitiesHelpers
-
context "access granted" do
before do
project.team << [user, :developer]
@@ -183,7 +181,7 @@ describe API::Internal, api: true do
expect(response).to have_http_status(200)
expect(json_response["status"]).to be_truthy
expect(json_response["repository_path"]).to eq(project.wiki.repository.path_to_repo)
- expect(user_score).to be_zero
+ expect(user).not_to have_an_activity_record
end
end
@@ -194,7 +192,7 @@ describe API::Internal, api: true do
expect(response).to have_http_status(200)
expect(json_response["status"]).to be_truthy
expect(json_response["repository_path"]).to eq(project.wiki.repository.path_to_repo)
- expect(user_score).not_to be_zero
+ expect(user).to have_an_activity_record
end
end
@@ -205,7 +203,7 @@ describe API::Internal, api: true do
expect(response).to have_http_status(200)
expect(json_response["status"]).to be_truthy
expect(json_response["repository_path"]).to eq(project.repository.path_to_repo)
- expect(user_score).not_to be_zero
+ expect(user).to have_an_activity_record
end
end
@@ -216,7 +214,7 @@ describe API::Internal, api: true do
expect(response).to have_http_status(200)
expect(json_response["status"]).to be_truthy
expect(json_response["repository_path"]).to eq(project.repository.path_to_repo)
- expect(user_score).to be_zero
+ expect(user).not_to have_an_activity_record
end
context 'project as /namespace/project' do
@@ -252,7 +250,7 @@ describe API::Internal, api: true do
expect(response).to have_http_status(200)
expect(json_response["status"]).to be_falsey
- expect(user_score).to be_zero
+ expect(user).not_to have_an_activity_record
end
end
@@ -262,7 +260,7 @@ describe API::Internal, api: true do
expect(response).to have_http_status(200)
expect(json_response["status"]).to be_falsey
- expect(user_score).to be_zero
+ expect(user).not_to have_an_activity_record
end
end
end
@@ -280,7 +278,7 @@ describe API::Internal, api: true do
expect(response).to have_http_status(200)
expect(json_response["status"]).to be_falsey
- expect(user_score).to be_zero
+ expect(user).not_to have_an_activity_record
end
end
@@ -290,7 +288,7 @@ describe API::Internal, api: true do
expect(response).to have_http_status(200)
expect(json_response["status"]).to be_falsey
- expect(user_score).to be_zero
+ expect(user).not_to have_an_activity_record
end
end
end