Sha256: 5c6952fcac09ce01c1b95e9a40469e04264350aa60b6cd98afb0d9694f9805ba

Contents?: true

Size: 758 Bytes

Versions: 4

Compression:

Stored size: 758 Bytes

Contents

require 'spec_helper'

class TestUserModel
    include Adauth::Rails::ModelBridge
    
    attr_accessor :name
    
    AdauthMappings = {
        :name => :name
    }
    
    AdauthSearchField = [:name]
    
    def self.find_by_name(name)
        TestUserModel.new
    end
    
    def save
        return true
    end
end

describe Adauth::Rails::ModelBridge do
    it "should extend", :no_ad => true do
        TestUserModel.should respond_to :create_from_adauth
    end
    
    it "should create the model" do
        default_config
        TestUserModel.create_from_adauth(administrator)
    end
    
    it "should return and create the model" do
        default_config
        TestUserModel.return_and_create_from_adauth(administrator)
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
adauth-2.0.0 spec/adauth_rails_model_bridge_spec.rb
adauth-2.0.0pre2 spec/adauth_rails_model_bridge_spec.rb
adauth-2.0.0pre1 spec/adauth_rails_model_bridge_spec.rb
adauth-2.0.0pre spec/adauth_rails_model_bridge_spec.rb