Sha256: 346c3dde19814cf7ef4b4dbb54ded9146b56c927679d566cfa187a83e46f6b90

Contents?: true

Size: 975 Bytes

Versions: 7

Compression:

Stored size: 975 Bytes

Contents

require 'spec_helper'
#require 'active_record'
#Opal::RSpec::Runner.autorun

class Thing < ActiveRecord::Base
end

class ThingContainer < ActiveRecord::Base
  composed_of :thing
  composed_of :another_thing, :class_name => Thing
end


describe "ActiveRecord" do
  after(:each) { React::API.clear_component_class_cache }

  # uncomment if you are having trouble with tests failing.  One non-async test must pass for things to work

  # describe "a passing dummy test" do
  #   it "passes" do
  #     expect(true).to be(true)
  #   end
  # end

  describe "Aggregation Reflection" do

    it "knows the aggregates class" do
      expect(ThingContainer.reflect_on_aggregation(:thing).klass).to eq(Thing)
    end

    it "knows the aggregates attribute" do
      expect(ThingContainer.reflect_on_aggregation(:thing).attribute).to eq(:thing)
    end

    it "knows all the Aggregates" do
      expect(ThingContainer.reflect_on_all_aggregations.count).to eq(2)
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hyper-mesh-0.6.0 reactive_record_test_app/spec-opal/active-record/aggregations_spec.rb
hyper-mesh-0.5.4 reactive_record_test_app/spec-opal/active-record/aggregations_spec.rb
hyper-mesh-0.5.3 reactive_record_test_app/spec-opal/active-record/aggregations_spec.rb
hyper-mesh-0.5.2 reactive_record_test_app/spec-opal/active-record/aggregations_spec.rb
hyper-mesh-0.5.1 reactive_record_test_app/spec-opal/active-record/aggregations_spec.rb
hyper-mesh-0.5.0 reactive_record_test_app/spec-opal/active-record/aggregations_spec.rb
hyper-mesh-0.4.0 reactive_record_test_app/spec-opal/active-record/aggregations_spec.rb