Skip to content

Commit

Permalink
Merge pull request ManageIQ#14338 from isimluk/check-charts-headers
Browse files Browse the repository at this point in the history
Specs: check that counts match for headers and col_order for charts
  • Loading branch information
martinpovolny authored Mar 15, 2017
2 parents 95952ef + e4a592d commit 120896e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/product/reports_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
describe 'YAML reports' do
let(:report_dirs) { [REPORTS_FOLDER, "#{TIMELINES_FOLDER}/miq_reports"] }
let(:report_yamls) { report_dirs.collect { |dir| Dir.glob(File.join(dir, "**", "*.yaml")) }.flatten }
let(:chart_dirs) { [CHARTS_REPORTS_FOLDER] }
let(:chart_yamls) { chart_dirs.collect { |dir| Dir.glob(File.join(dir, "**", "*.yaml")) }.flatten }
let!(:user) { FactoryGirl.create(:user_with_group) }

# TODO: CHARTS_REPORTS_FOLDER

before :each do
EvmSpecHelper.local_miq_server
@user = FactoryGirl.create(:user_with_group)
Expand All @@ -15,6 +15,7 @@
end

it 'can be build even though without data' do
# TODO: CHARTS_REPORTS_FOLDER
report_yamls.each do |yaml|
report_data = YAML.load(File.open(yaml))
report_data.delete('menu_name')
Expand All @@ -26,7 +27,7 @@
end

it 'defines headers that match col_order' do
report_yamls.each do |yaml|
(chart_yamls + report_yamls).each do |yaml|
report_data = YAML.load(File.open(yaml))
col_order = report_data['col_order'].length
headers = report_data['headers'].length
Expand Down

0 comments on commit 120896e

Please sign in to comment.