Sha256: 3faa2b6812436ba304cf4ca2726cbf8ccb9058942510436e7ca78d272ac98c6a
Contents?: true
Size: 874 Bytes
Versions: 4
Compression:
Stored size: 874 Bytes
Contents
class MockModel attr_accessor :attributes, :called_save, :called_destroy extend TmsBridge::ModelSupport NOT_FOUND=false FOUND=true def self.column_names ['updated_at', 'created_at', 'id', 'some_key'] end def save(*args) self.called_save = true end def destroy self.called_destroy = true end def self.find_by_tms_id(tms_id) return tms_id == FOUND ? FoundMockPublishing.new : nil end end class MockPublishing<MockModel end class FoundMockPublishing<MockModel end class MockController cattr_accessor :before_filters attr_accessor :json attr_reader :request def self.before_filter(filter) @@before_filters ||= [] @@before_filters << filter end def initialize @request = MockRequest.new end def head(*args);end def render(*args);end end class MockRequest attr_accessor :raw_post end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
tms_bridge-0.1.2 | spec/tms_bridge/mocks.rb |
tms_bridge-0.1.1 | spec/tms_bridge/mocks.rb |
tms_bridge-0.1 | spec/tms_bridge/mocks.rb |
tms_bridge-0.0.10 | spec/tms_bridge/mocks.rb |