Sha256: 7f189369bcbd1edb15726ec5bbefa3e5aedc740a20644f5f0504c400f07e5802

Contents?: true

Size: 994 Bytes

Versions: 5

Compression:

Stored size: 994 Bytes

Contents

require 'spec/spec_helper'
require 'user'


  
describe "Reactive Record" 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 "reactive_record basic api" do
    
    rendering("a simple component") do
      div {"hello"}
    end.should_immediately_generate do |component|
      component.html == "hello"
    end
    
    rendering("a find_by query") do
      User.find_by_email("mitch@catprint.com").email
    end.should_immediately_generate do 
      html == "mitch@catprint.com"
    end
    
    it "should yield the same find_by result if called twice" do
      ar1 = User.find_by_email("mitch@catprint.com")
      ar2 = User.find_by_email("mitch@catprint.com")
      expect(ar1.equal?(ar2)).to be(true)
    end
    
    
  end
  
end
  

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hyper-mesh-0.5.3 reactive_record_test_app/app/assets/javascripts/spec/reactive_record_xspec.js.rb
hyper-mesh-0.5.2 reactive_record_test_app/app/assets/javascripts/spec/reactive_record_xspec.js.rb
hyper-mesh-0.5.1 reactive_record_test_app/app/assets/javascripts/spec/reactive_record_xspec.js.rb
hyper-mesh-0.5.0 reactive_record_test_app/app/assets/javascripts/spec/reactive_record_xspec.js.rb
hyper-mesh-0.4.0 reactive_record_test_app/app/assets/javascripts/spec/reactive_record_xspec.js.rb