debian-mirror-gitlab/spec/helpers/ci/jobs_helper_spec.rb

28 lines
685 B
Ruby
Raw Normal View History

2022-01-26 12:08:38 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Ci::JobsHelper do
describe 'jobs data' do
let(:project) { create(:project, :repository) }
2022-03-02 08:16:31 +05:30
let(:bridge) { create(:ci_bridge) }
2022-01-26 12:08:38 +05:30
2022-03-02 08:16:31 +05:30
subject(:bridge_data) { helper.bridge_data(bridge, project) }
2022-01-26 12:08:38 +05:30
before do
allow(helper)
.to receive(:image_path)
.and_return('/path/to/illustration')
end
it 'returns bridge data' do
expect(bridge_data).to eq({
2022-03-02 08:16:31 +05:30
"build_id" => bridge.id,
"empty-state-illustration-path" => '/path/to/illustration',
"pipeline_iid" => bridge.pipeline.iid,
"project_full_path" => project.full_path
2022-01-26 12:08:38 +05:30
})
end
end
end