summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2019-05-07 10:06:50 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2019-05-07 10:25:28 +0200
commit4d405acb6a2a7779a6f22772d3089ade90d34058 (patch)
tree0f42f03e5edc5a3cb6a9b3f09f706570b5937d4a /spec
parent5cd079e43498982dcef59e32ebf03d6fe6a06286 (diff)
downloadgitlab-ce-4d405acb6a2a7779a6f22772d3089ade90d34058.tar.gz
Set created_at and updated_at for sorting specs
This makes sure that the results are predictable and the same on both Postgres and MySQL
Diffstat (limited to 'spec')
-rw-r--r--spec/features/dashboard/user_filters_projects_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/features/dashboard/user_filters_projects_spec.rb b/spec/features/dashboard/user_filters_projects_spec.rb
index e0553086fd7..5b17c49db2d 100644
--- a/spec/features/dashboard/user_filters_projects_spec.rb
+++ b/spec/features/dashboard/user_filters_projects_spec.rb
@@ -2,9 +2,9 @@ require 'spec_helper'
describe 'Dashboard > User filters projects' do
let(:user) { create(:user) }
- let(:project) { create(:project, name: 'Victorialand', namespace: user.namespace) }
+ let(:project) { create(:project, name: 'Victorialand', namespace: user.namespace, created_at: 2.seconds.ago, updated_at: 2.seconds.ago) }
let(:user2) { create(:user) }
- let(:project2) { create(:project, name: 'Treasure', namespace: user2.namespace) }
+ let(:project2) { create(:project, name: 'Treasure', namespace: user2.namespace, created_at: 1.second.ago, updated_at: 1.second.ago) }
before do
project.add_maintainer(user)
@@ -129,7 +129,7 @@ describe 'Dashboard > User filters projects' do
list = page.all('.projects-list .project-name').map(&:text)
- expect(list).to match(["Private project", "Treasure", "Victorialand"])
+ expect(list).to contain_exactly("Private project", "Treasure", "Victorialand")
end
it 'filters internal projects only' do
@@ -139,14 +139,14 @@ describe 'Dashboard > User filters projects' do
list = page.all('.projects-list .project-name').map(&:text)
- expect(list).to match(['Internal project'])
+ expect(list).to contain_exactly('Internal project')
end
it 'filters any project' do
select_dropdown_option '#filtered-search-visibility-dropdown', 'Any'
list = page.all('.projects-list .project-name').map(&:text)
- expect(list).to match(["Internal project", "Private project", "Treasure", "Victorialand"])
+ expect(list).to contain_exactly("Internal project", "Private project", "Treasure", "Victorialand")
end
end