| ... | @@ -194,6 +194,11 @@ describe Notify do |
... | @@ -194,6 +194,11 @@ describe Notify do |
|
|
let(:new_issue) { create(:issue) }
|
|
let(:new_issue) { create(:issue) }
|
|
|
subject { described_class.issue_moved_email(recipient, issue, new_issue, current_user) }
|
|
subject { described_class.issue_moved_email(recipient, issue, new_issue, current_user) }
|
|
|
|
|
|
|
|
|
context 'when a user has permissions to access the new issue' do
|
|
|
|
before do
|
|
|
|
new_issue.project.add_developer(recipient)
|
|
|
|
end
|
|
|
|
|
|
|
it_behaves_like 'an answer to an existing thread with reply-by-email enabled' do
|
|
it_behaves_like 'an answer to an existing thread with reply-by-email enabled' do
|
|
|
let(:model) { issue }
|
|
let(:model) { issue }
|
|
|
end
|
|
end
|
| ... | @@ -213,6 +218,31 @@ describe Notify do |
... | @@ -213,6 +218,31 @@ describe Notify do |
|
|
is_expected.to have_body_text(project_issue_path(project, issue))
|
|
is_expected.to have_body_text(project_issue_path(project, issue))
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
it 'contains the issue title' do
|
|
|
|
is_expected.to have_body_text new_issue.title
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when a user does not permissions to access the new issue' do
|
|
|
|
it 'has the correct subject and body' do
|
|
|
|
new_issue_url = project_issue_path(new_issue.project, new_issue)
|
|
|
|
|
|
|
|
aggregate_failures do
|
|
|
|
is_expected.to have_referable_subject(issue, reply: true)
|
|
|
|
is_expected.not_to have_body_text(new_issue_url)
|
|
|
|
is_expected.to have_body_text(project_issue_path(project, issue))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not contain the issue title' do
|
|
|
|
is_expected.not_to have_body_text new_issue.title
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'contains information about missing permissions' do
|
|
|
|
is_expected.to have_body_text "You don't have access to the project."
|
|
|
|
end
|
|
|
|
end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
| ... | |
... | |
| ... | | ... | |