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

applications_controller_shared_examples.rb « requests « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4a7a7492398c328013f0870f10c0f96a72996d63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

RSpec.shared_examples 'applications controller - GET #show' do
  describe 'GET #show' do
    it 'renders template' do
      get show_path

      expect(response).to render_template :show
    end
  end
end

RSpec.shared_examples 'applications controller - POST #create' do
  it "sets `@created` instance variable to `true`" do
    create_application

    expect(assigns[:created]).to eq(true)
  end
end

def create_application
  create_params = attributes_for(:application, trusted: true, confidential: false, scopes: ['api'])
  post create_path, params: { doorkeeper_application: create_params }
end