2015-09-23 06:34:21 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe CiStatusHelper do
|
|
|
|
include IconsHelper
|
|
|
|
|
2016-06-02 10:19:18 -04:00
|
|
|
let(:success_commit) { double("Ci::Pipeline", status: 'success') }
|
|
|
|
let(:failed_commit) { double("Ci::Pipeline", status: 'failed') }
|
2015-09-23 06:34:21 -04:00
|
|
|
|
2016-04-13 09:58:22 -04:00
|
|
|
describe 'ci_icon_for_status' do
|
2016-07-19 14:11:52 -04:00
|
|
|
it 'renders to correct svg on success' do
|
|
|
|
expect(helper).to receive(:render).with('shared/icons/icon_status_success.svg', anything)
|
|
|
|
helper.ci_icon_for_status(success_commit.status)
|
|
|
|
end
|
|
|
|
it 'renders the correct svg on failure' do
|
|
|
|
expect(helper).to receive(:render).with('shared/icons/icon_status_failed.svg', anything)
|
|
|
|
helper.ci_icon_for_status(failed_commit.status)
|
|
|
|
end
|
2015-09-23 06:34:21 -04:00
|
|
|
end
|
|
|
|
end
|