Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorImre Farkas <ifarkas@gitlab.com>2018-07-12 14:21:08 +0300
committerImre Farkas <ifarkas@gitlab.com>2018-07-18 16:44:10 +0300
commitc62fce988308e545488cbb32569f022e771aa799 (patch)
tree3d1130eaaf27dbcbfab7168f5b69a12169b69a6a /spec/requests
parent1ba47de5fef7a86a453e97a574741d3dba85c521 (diff)
Delete UserActivities and related workers
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/internal_spec.rb16
-rw-r--r--spec/requests/git_http_spec.rb5
2 files changed, 10 insertions, 11 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index a56b913198c..a2cfa706f58 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -279,7 +279,7 @@ describe API::Internal do
expect(json_response["status"]).to be_truthy
expect(json_response["repository_path"]).to eq('/')
expect(json_response["gl_repository"]).to eq("wiki-#{project.id}")
- expect(user).not_to have_an_activity_record
+ expect(user.reload.last_activity_on).to be_nil
end
end
@@ -291,7 +291,7 @@ describe API::Internal do
expect(json_response["status"]).to be_truthy
expect(json_response["repository_path"]).to eq('/')
expect(json_response["gl_repository"]).to eq("wiki-#{project.id}")
- expect(user).to have_an_activity_record
+ expect(user.reload.last_activity_on).to eql(Date.today)
end
end
@@ -309,7 +309,7 @@ describe API::Internal do
expect(json_response["gitaly"]["repository"]["relative_path"]).to eq(project.repository.gitaly_repository.relative_path)
expect(json_response["gitaly"]["address"]).to eq(Gitlab::GitalyClient.address(project.repository_storage))
expect(json_response["gitaly"]["token"]).to eq(Gitlab::GitalyClient.token(project.repository_storage))
- expect(user).to have_an_activity_record
+ expect(user.reload.last_activity_on).to eql(Date.today)
end
end
@@ -328,7 +328,7 @@ describe API::Internal do
expect(json_response["gitaly"]["repository"]["relative_path"]).to eq(project.repository.gitaly_repository.relative_path)
expect(json_response["gitaly"]["address"]).to eq(Gitlab::GitalyClient.address(project.repository_storage))
expect(json_response["gitaly"]["token"]).to eq(Gitlab::GitalyClient.token(project.repository_storage))
- expect(user).not_to have_an_activity_record
+ expect(user.reload.last_activity_on).to be_nil
end
end
end
@@ -345,7 +345,7 @@ describe API::Internal do
expect(response).to have_gitlab_http_status(200)
expect(json_response["status"]).to be_falsey
- expect(user).not_to have_an_activity_record
+ expect(user.reload.last_activity_on).to be_nil
end
end
@@ -355,7 +355,7 @@ describe API::Internal do
expect(response).to have_gitlab_http_status(200)
expect(json_response["status"]).to be_falsey
- expect(user).not_to have_an_activity_record
+ expect(user.reload.last_activity_on).to be_nil
end
end
end
@@ -373,7 +373,7 @@ describe API::Internal do
expect(response).to have_gitlab_http_status(200)
expect(json_response["status"]).to be_falsey
- expect(user).not_to have_an_activity_record
+ expect(user.reload.last_activity_on).to be_nil
end
end
@@ -383,7 +383,7 @@ describe API::Internal do
expect(response).to have_gitlab_http_status(200)
expect(json_response["status"]).to be_falsey
- expect(user).not_to have_an_activity_record
+ expect(user.reload.last_activity_on).to be_nil
end
end
end
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb
index b030d9862c6..0f3e7157e14 100644
--- a/spec/requests/git_http_spec.rb
+++ b/spec/requests/git_http_spec.rb
@@ -5,7 +5,6 @@ describe 'Git HTTP requests' do
include TermsHelper
include GitHttpHelpers
include WorkhorseHelpers
- include UserActivitiesHelpers
shared_examples 'pulls require Basic HTTP Authentication' do
context "when no credentials are provided" do
@@ -440,10 +439,10 @@ describe 'Git HTTP requests' do
end
it 'updates the user last activity', :clean_gitlab_redis_shared_state do
- expect(user_activity(user)).to be_nil
+ expect(user.last_activity_on).to be_nil
download(path, env) do |response|
- expect(user_activity(user)).to be_present
+ expect(user.reload.last_activity_on).to eql(Date.today)
end
end
end