Commit 245d4abb authored by Adam Niedzielski's avatar Adam Niedzielski

Single quotes all the way.

parent 0c3ac827
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment