Sha256: 1474f265974951180e34992af238a6ac263143f993de7f91557a66cec179a71a

Contents?: true

Size: 938 Bytes

Versions: 5

Compression:

Stored size: 938 Bytes

Contents

require 'rails_helper'
require 'rspec_api_documentation/dsl'

resource 'Configuration' do
  header 'AUTHORIZATION', :token

  let(:user) { FactoryGirl.create :user_with_token }
  let(:token) { ActionController::HttpAuthentication::Token.encode_credentials user.user_tokens.first.try(:token), installation_identifier: user.user_tokens.first.try(:installation_identifier) }

  get '/v1/configuration', format: :json do
    example_request 'show' do
      response_json = JSON.parse response_body

      expect(status).to eq(200)
      expect(response_json['pusher']['url']).to eq(Rails.application.secrets.pusher_url)
      expect(response_json['aws']['access_key_id']).to eq(Rails.application.secrets.aws_access_key_id)
      expect(response_json['aws']['secret_access_key']).to eq(Rails.application.secrets.aws_secret_access_key)
      expect(response_json['aws']['s3_bucket']).to eq(Rails.application.secrets.s3_bucket)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
happy_seed-0.0.19 lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/configurations_spec.rb
happy_seed-0.0.18 lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/configurations_spec.rb
happy_seed-0.0.17 lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/configurations_spec.rb
happy_seed-0.0.16 lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/configurations_spec.rb
happy_seed-0.0.15 lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/configurations_spec.rb