Commit af80fcb4 authored by James Lopez's avatar James Lopez

fix specs

parent ed39d61d
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
@order || @start_time_attrs @order || @start_time_attrs
end end
def query(base_query); end def query(_base_query); end
def fetch(query) def fetch(query)
query.execute(self).map { |event| serialize(event, query) } query.execute(self).map { |event| serialize(event, query) }
...@@ -18,7 +18,7 @@ module Gitlab ...@@ -18,7 +18,7 @@ module Gitlab
private private
def serialize(event, query) def serialize(_event, _query)
raise NotImplementedError.new("Expected #{self.name} to implement serialize(event)") raise NotImplementedError.new("Expected #{self.name} to implement serialize(event)")
end end
end end
......
...@@ -13,7 +13,7 @@ module Gitlab ...@@ -13,7 +13,7 @@ module Gitlab
issue_table[:created_at], issue_table[:created_at],
issue_table[:author_id]] issue_table[:author_id]]
def self.serialize(event, query) def self.serialize(event, query)#
event['author'] = User.find(event.delete('author_id')) event['author'] = User.find(event.delete('author_id'))
AnalyticsIssueSerializer.new(project: query.project).represent(event).as_json AnalyticsIssueSerializer.new(project: query.project).represent(event).as_json
......
...@@ -41,4 +41,4 @@ module Gitlab ...@@ -41,4 +41,4 @@ module Gitlab
end end
end end
end end
end end
\ No newline at end of file
...@@ -11,7 +11,7 @@ module Gitlab ...@@ -11,7 +11,7 @@ module Gitlab
mr_table[:state], mr_table[:state],
mr_table[:author_id]] mr_table[:author_id]]
def self.serialize(event, _query) def self.serialize(event, query)
event['author'] = User.find(event.delete('author_id')) event['author'] = User.find(event.delete('author_id'))
AnalyticsMergeRequestSerializer.new(project: query.project).represent(event).as_json AnalyticsMergeRequestSerializer.new(project: query.project).represent(event).as_json
......
...@@ -5,15 +5,15 @@ shared_examples 'default query config' do ...@@ -5,15 +5,15 @@ shared_examples 'default query config' do
expect(described_class.start_time_attrs).not_to be_nil expect(described_class.start_time_attrs).not_to be_nil
end end
it 'has the stage attribute' do
expect(described_class.stage).not_to be_nil
end
it 'has the end attributes' do it 'has the end attributes' do
expect(described_class.end_time_attrs ).not_to be_nil expect(described_class.end_time_attrs).not_to be_nil
end end
it 'has the projection attributes' do it 'has the projection attributes' do
expect(described_class.projections).not_to be_nil expect(described_class.projections).not_to be_nil
end end
it 'implements the fetch method' do
expect(described_class.fetch).not_to raise_error
end
end 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