Sha256: 25ff9f3f71e8077b6095cc027cd8f545f33b8dec943de6d9c7286b815c757217

Contents?: true

Size: 759 Bytes

Versions: 33

Compression:

Stored size: 759 Bytes

Contents

require 'spec_helper'

describe Maestrano::DependanciesController, type: :controller do
  routes { Maestrano::Connector::Rails::Engine.routes }

  describe 'index' do
    subject { get :index }

    context 'without authentication' do
      before {
        controller.class.before_filter :authenticate_maestrano!
      }

      it 'respond with unauthorized' do
        subject
        expect(response.status).to eq(401)
      end
    end

    context 'with authentication' do
      before {
        controller.class.skip_before_filter :authenticate_maestrano!
      }

      it 'renders the dependancies hash' do
        subject
        expect(response.body).to eql(Maestrano::Connector::Rails::ConnecHelper.dependancies.to_json)
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.0.0.pre.RC2 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-2.0.0.pre.RC1 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.4.0 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.3.5 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.3.4 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.3.3 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.3.2 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.3.1 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.3.0 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.2.3 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.2.2 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.2.1 spec/controllers/dependancies_controller_spec.rb
maestrano-connector-rails-1.2.0 spec/controllers/dependancies_controller_spec.rb