Sha256: 1c1aa0df6826852658723d7d7ea61070d3671271e9202e25191f999101badc29

Contents?: true

Size: 811 Bytes

Versions: 2

Compression:

Stored size: 811 Bytes

Contents

require 'spec_helper'
require 'rails'
require 'concerned'
require 'active_support/dependencies'

# The same procedure as one that needed for common #require - It should know path.
$:.unshift File.dirname __FILE__

class FixtureUser
  concerned_with :scopes, :validations
  shared_concerns :associations
  include_shared_concerns :caching
end

describe "Concerned" do
  describe "#concerned_with" do
    it 'should require files from #{name.underscore}/#{concern}' do
      [:scopes, :validations].each do |concern|
        FixtureUser.new.should respond_to("method_from_#{concern}_concern")
      end
    end
  end 
   
  describe "#include_shared_concerns" do
    it 'should require and include from shared/#{concern}' do
      FixtureUser.new.should respond_to("method_from_shared_concern")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
concerned-0.1.1 spec/concerned_spec.rb
concerned-0.1.0 spec/concerned_spec.rb