debian-mirror-gitlab/spec/views/notify/changed_milestone_email.html.haml_spec.rb
2020-08-09 17:44:08 +05:30

35 lines
1 KiB
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'notify/changed_milestone_email.html.haml' do
let(:milestone) { create(:milestone, title: 'some-milestone') }
let(:milestone_link) { milestone_url(milestone) }
before do
assign(:milestone, milestone)
assign(:milestone_url, milestone_link)
end
context 'milestone without start and due dates' do
it 'renders without date range' do
render
expect(rendered).to have_content('Milestone changed to some-milestone', exact: true)
expect(rendered).to have_link('some-milestone', href: milestone_link)
end
end
context 'milestone with start and due dates' do
before do
milestone.update(start_date: '2018-01-01', due_date: '2018-12-31')
end
it 'renders with date range' do
render
expect(rendered).to have_content('Milestone changed to some-milestone (Jan 1, 2018Dec 31, 2018)', exact: true)
expect(rendered).to have_link('some-milestone', href: milestone_link)
end
end
end