diff options
4 files changed, 11 insertions, 11 deletions
diff --git a/app/views/shared/members/_member.html.haml b/app/views/shared/members/_member.html.haml index c215445f123..0db7ecb61bb 100644 --- a/app/views/shared/members/_member.html.haml +++ b/app/views/shared/members/_member.html.haml @@ -61,7 +61,7 @@ Joined #{time_ago_with_tooltip(member.created_at)} - if member.expires? ยท - %span{ class: ("text-warning" if member_expires_soon?(member)) } + %span{ class: ('text-warning' if member_expires_soon?(member)) } Expires in #{distance_of_time_in_words_to_now(member.expires_at)} - else diff --git a/app/workers/remove_expired_members_worker.rb b/app/workers/remove_expired_members_worker.rb index 027abf50587..2d773ec72df 100644 --- a/app/workers/remove_expired_members_worker.rb +++ b/app/workers/remove_expired_members_worker.rb @@ -2,7 +2,7 @@ class RemoveExpiredMembersWorker include Sidekiq::Worker def perform - Member.where("expires_at <= ?", Time.current).find_each do |member| + Member.where('expires_at <= ?', Time.current).find_each do |member| begin Members::AuthorizedDestroyService.new(member).execute rescue => ex diff --git a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb index 400c7e477d2..47a72a82cf3 100644 --- a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb +++ b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb @@ -14,12 +14,12 @@ feature 'Projects > Members > Master adds member with expiration date', feature: end scenario 'expiration date is displayed in the members list' do - travel_to Time.zone.parse("2016-08-06 08:00") do + travel_to Time.zone.parse('2016-08-06 08:00') do visit namespace_project_project_members_path(project.namespace, project) page.within '.users-project-form' do select2(new_member.id, from: '#user_ids', multiple: true) - fill_in 'Access expiration date', with: "2016-08-10" + fill_in 'Access expiration date', with: '2016-08-10' click_on 'Add users to project' end @@ -30,13 +30,13 @@ feature 'Projects > Members > Master adds member with expiration date', feature: end scenario 'change expiration date' do - travel_to Time.zone.parse("2016-08-06 08:00") do - project.team.add_users([new_member.id], :developer, expires_at: "2016-09-06") + travel_to Time.zone.parse('2016-08-06 08:00') do + project.team.add_users([new_member.id], :developer, expires_at: '2016-09-06') visit namespace_project_project_members_path(project.namespace, project) page.within '.project_member:first-child' do click_on 'Edit' - fill_in 'Access expiration date', with: "2016-08-09" + fill_in 'Access expiration date', with: '2016-08-09' click_on 'Save' expect(page).to have_content('Expires in 3 days') end diff --git a/spec/workers/remove_expired_members_worker_spec.rb b/spec/workers/remove_expired_members_worker_spec.rb index 086f6e7c301..75a5bee7ab4 100644 --- a/spec/workers/remove_expired_members_worker_spec.rb +++ b/spec/workers/remove_expired_members_worker_spec.rb @@ -6,18 +6,18 @@ describe RemoveExpiredMembersWorker do let!(:member_expiring_in_future) { create(:project_member, expires_at: 10.days.from_now) } let!(:non_expiring_member) { create(:project_member, expires_at: nil) } - describe "#perform" do - it "removes expired members" do + describe '#perform' do + it 'removes expired members' do expect { worker.perform }.to change { Member.count }.by(-1) expect(Member.find_by(id: expired_member.id)).to be_nil end - it "leaves members who expire in the future" do + it 'leaves members who expire in the future' do worker.perform expect(member_expiring_in_future.reload).to be_present end - it "leaves members who do not expire at all" do + it 'leaves members who do not expire at all' do worker.perform expect(non_expiring_member.reload).to be_present end |