diff options
author | Takuya Noguchi <takninnovationresearch@gmail.com> | 2018-04-05 23:56:32 +0900 |
---|---|---|
committer | Takuya Noguchi <takninnovationresearch@gmail.com> | 2018-05-19 07:19:58 +0900 |
commit | d8a9bfb6b7e17812915fe6767158abaca2ea6a74 (patch) | |
tree | ea9b24e615fba813aa26ab4a02b1b6b0455eea0c /spec/finders | |
parent | 2e350216cdf56c00a84d0be93b64f3db2f4d9cff (diff) | |
download | gitlab-ce-d8a9bfb6b7e17812915fe6767158abaca2ea6a74.tar.gz |
Order UsersController#projects.json by updated_at
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/personal_projects_finder_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/finders/personal_projects_finder_spec.rb b/spec/finders/personal_projects_finder_spec.rb index 5e52898e9c0..00c551a1f65 100644 --- a/spec/finders/personal_projects_finder_spec.rb +++ b/spec/finders/personal_projects_finder_spec.rb @@ -4,14 +4,16 @@ describe PersonalProjectsFinder do let(:source_user) { create(:user) } let(:current_user) { create(:user) } let(:finder) { described_class.new(source_user) } - let!(:public_project) { create(:project, :public, namespace: source_user.namespace) } + let!(:public_project) do + create(:project, :public, namespace: source_user.namespace, updated_at: 1.hour.ago) + end let!(:private_project) do - create(:project, :private, namespace: source_user.namespace, path: 'mepmep') + create(:project, :private, namespace: source_user.namespace, updated_at: 3.hours.ago, path: 'mepmep') end let!(:internal_project) do - create(:project, :internal, namespace: source_user.namespace, path: 'C') + create(:project, :internal, namespace: source_user.namespace, updated_at: 2.hours.ago, path: 'C') end before do @@ -28,7 +30,7 @@ describe PersonalProjectsFinder do subject { finder.execute(current_user) } context 'normal user' do - it { is_expected.to eq([internal_project, private_project, public_project]) } + it { is_expected.to eq([public_project, internal_project, private_project]) } end context 'external' do @@ -36,7 +38,7 @@ describe PersonalProjectsFinder do current_user.update_attributes(external: true) end - it { is_expected.to eq([private_project, public_project]) } + it { is_expected.to eq([public_project, private_project]) } end end end |