Welcome to mirror list, hosted at ThFree Co, Russian Federation.

emails_controller_spec.rb « profiles « controllers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 00862f12b7ef417ca1599475187a7fdbb72f77e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'spec_helper'

describe Profiles::EmailsController do

  let(:user) { create(:user) }

  before do
    sign_in(user)
  end

  describe '#create' do
    let(:email_params) { {email: "add_email@example.com" } }

    it 'sends an email confirmation' do
      expect {post(:create, { email: email_params })}.to change { ActionMailer::Base.deliveries.size }
      expect(ActionMailer::Base.deliveries.last.to).to eq [email_params[:email]]
      expect(ActionMailer::Base.deliveries.last.subject).to match "Confirmation instructions"
    end
  end
end