Sha256: 1f7949f0c8f13f2f273ebc9cd0e49e4602a5f6904c2c06514dbb003577afe2e7

Contents?: true

Size: 713 Bytes

Versions: 2

Compression:

Stored size: 713 Bytes

Contents

require 'spec_helper'
require 'test_components'

describe "HyperMesh.load", js: true do

  before(:each) do
    # spec_helper resets the policy system after each test so we have to setup
    # before each test
    stub_const 'TestApplication', Class.new
    stub_const 'TestApplicationPolicy', Class.new
    TestApplicationPolicy.class_eval do
      always_allow_connection
      regulate_all_broadcasts { |policy| policy.send_all }
    end
    size_window(:small, :portrait)
  end

  it "uses itself to force loading" do
    user = FactoryGirl.create(:user, first_name: 'Ima')
    expect_promise do
      HyperMesh.load { User.find_by_first_name('Ima') }.then { |user| user.id }
    end.to eq(user.id)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hyper-mesh-0.6.0 spec/batch3/auto_load_itself_spec.rb
hyper-mesh-0.5.4 spec/batch3/auto_load_itself_spec.rb