Sha256: e5ba6930adb8da28102f8e034f14ab5d4731895e7d3ce35ea9f18a56bc1ff2d6

Contents?: true

Size: 1.12 KB

Versions: 10

Compression:

Stored size: 1.12 KB

Contents

# Copyright (C) 2008-2011 AMEE UK Ltd. - http://www.amee.com
# Released as Open Source Software under the BSD 3-Clause license. See LICENSE.txt for details.

require 'spec_helper.rb'
require 'amee/rails'
require 'active_record'

describe AMEE::Rails do

  class AMEETest < ActiveRecord::Base
    include AMEE::Rails
  end

  it "should add the has_amee_profile method to a class which includes it" do
    AMEETest.respond_to?(:has_amee_profile).should be_true
  end
  
  describe "using has_amee_profile" do

    class HasProfileTest < AMEETest
      has_amee_profile
    end

    before(:each) do
      @test = disconnected HasProfileTest
    end
    
    it "should have an amee_connection function" do
      @test.klass.method_defined?(:amee_connection).should be_true
    end

    it "should have an amee_create function" do
      @test.klass.method_defined?(:amee_create).should be_true
    end

    it "should have an amee_save function" do
      @test.klass.method_defined?(:amee_save).should be_true
    end

    it "should have an amee_destroy function" do
      @test.klass.method_defined?(:amee_destroy).should be_true
    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
amee-4.2.0 spec/rails_spec.rb
amee-4.1.7 spec/rails_spec.rb
amee-4.1.6 spec/rails_spec.rb
amee-4.1.5 spec/rails_spec.rb
amee-4.1.4 spec/rails_spec.rb
amee-4.1.3 spec/rails_spec.rb
amee-4.1.2 spec/rails_spec.rb
amee-4.1.1 spec/rails_spec.rb
amee-4.1.0 spec/rails_spec.rb
amee-4.0.0 spec/rails_spec.rb