Sha256: 74b0b6d5d6d57c6d1de2adefe388e15646a923b602b157cee87bf2b5f9ed216c

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe Arpa::Entities::Resource, type: :entity, fast: true do

  describe '#build_correct_name' do

    before { subject.build_correct_name }

    context 'when pass :full_name as "UsersController"' do
      subject { Arpa::Entities::Resource.new full_name: 'UsersController' }

      it 'full_name should be "UsersController"' do
        expect(subject.full_name).to eql 'UsersController'
      end

      it 'name should be builded as "users"' do
        expect(subject.name).to eql 'users'
      end
    end

    context 'when pass :full_name as "Authentication::Someone::UsersController"' do
      subject { Arpa::Entities::Resource.new full_name: 'Authentication::Someone::UsersController' }

      it 'full_name should be "Authentication::Someone::UsersController"' do
        expect(subject.full_name).to eql 'Authentication::Someone::UsersController'
      end

      it 'name should be builded as "authentication/someone/users"' do
        expect(subject.name).to eql 'authentication/someone/users'
      end
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arpa-0.0.7 spec/lib/ar/entities/resource_spec.rb
arpa-0.0.6 spec/lib/ar/entities/resource_spec.rb
arpa-0.0.5 spec/lib/ar/entities/resource_spec.rb
arpa-0.0.4 spec/lib/ar/entities/resource_spec.rb
arpa-0.0.3 spec/lib/ar/entities/resource_spec.rb
arpa-0.0.2 spec/lib/ar/entities/resource_spec.rb