Commit af65c04d authored by Mark Chao's avatar Mark Chao

Add frozen string literal header

parent 74bdc9a3
# frozen_string_literal: true
module Epics module Epics
class DateSourcingMilestonesFinder class DateSourcingMilestonesFinder
def self.execute(epic_id) def self.execute(epic_id)
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Epics::DateSourcingMilestonesFinder do describe Epics::DateSourcingMilestonesFinder do
...@@ -13,10 +15,12 @@ describe Epics::DateSourcingMilestonesFinder do ...@@ -13,10 +15,12 @@ describe Epics::DateSourcingMilestonesFinder do
results = described_class.execute(epic.id) results = described_class.execute(epic.id)
expect(results.start_date).to eq(milestone1.start_date) expect(results).to have_attributes(
expect(results.start_date_sourcing_milestone_id).to eq(milestone1.id) start_date: milestone1.start_date,
expect(results.due_date).to eq(milestone2.due_date) start_date_sourcing_milestone_id: milestone1.id,
expect(results.due_date_sourcing_milestone_id).to eq(milestone2.id) due_date: milestone2.due_date,
due_date_sourcing_milestone_id: milestone2.id
)
end end
it 'returns date and id from single milestone' do it 'returns date and id from single milestone' do
...@@ -26,10 +30,12 @@ describe Epics::DateSourcingMilestonesFinder do ...@@ -26,10 +30,12 @@ describe Epics::DateSourcingMilestonesFinder do
results = described_class.execute(epic.id) results = described_class.execute(epic.id)
expect(results.start_date).to eq(milestone1.start_date) expect(results).to have_attributes(
expect(results.start_date_sourcing_milestone_id).to eq(milestone1.id) start_date: milestone1.start_date,
expect(results.due_date).to eq(milestone1.due_date) start_date_sourcing_milestone_id: milestone1.id,
expect(results.due_date_sourcing_milestone_id).to eq(milestone1.id) due_date: milestone1.due_date,
due_date_sourcing_milestone_id: milestone1.id
)
end end
it 'returns date and id from milestone without date' do it 'returns date and id from milestone without date' do
...@@ -39,10 +45,12 @@ describe Epics::DateSourcingMilestonesFinder do ...@@ -39,10 +45,12 @@ describe Epics::DateSourcingMilestonesFinder do
results = described_class.execute(epic.id) results = described_class.execute(epic.id)
expect(results.start_date).to eq(milestone1.start_date) expect(results).to have_attributes(
expect(results.start_date_sourcing_milestone_id).to eq(milestone1.id) start_date: milestone1.start_date,
expect(results.due_date).to eq(nil) start_date_sourcing_milestone_id: milestone1.id,
expect(results.due_date_sourcing_milestone_id).to eq(nil) due_date: nil,
due_date_sourcing_milestone_id: nil
)
end end
it 'handles epics without milestone' do it 'handles epics without milestone' do
...@@ -50,10 +58,12 @@ describe Epics::DateSourcingMilestonesFinder do ...@@ -50,10 +58,12 @@ describe Epics::DateSourcingMilestonesFinder do
results = described_class.execute(epic.id) results = described_class.execute(epic.id)
expect(results.start_date).to eq(nil) expect(results).to have_attributes(
expect(results.start_date_sourcing_milestone_id).to eq(nil) start_date: nil,
expect(results.due_date).to eq(nil) start_date_sourcing_milestone_id: nil,
expect(results.due_date_sourcing_milestone_id).to eq(nil) due_date: nil,
due_date_sourcing_milestone_id: nil
)
end end
end end
end end
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
require Rails.root.join('ee', 'db', 'post_migrate', '20180713171825_update_epic_dates_from_milestones.rb') require Rails.root.join('ee', 'db', 'post_migrate', '20180713171825_update_epic_dates_from_milestones.rb')
......
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