Sha256: af419f9628547b99c94b56a3a839944d19c1522b18bc338752fc3fc4ea5cf5dc
Contents?: true
Size: 731 Bytes
Versions: 9
Compression:
Stored size: 731 Bytes
Contents
require 'spec_helper' if RUBY_PLATFORM != 'opal' describe Volt::ModelController do it 'should accept a promise as a model and resolve it' do controller = Volt::ModelController.new(volt_app) promise = Promise.new controller.model = promise expect(controller.model).to eq(nil) promise.resolve(20) expect(controller.model).to eq(20) end it 'should not return true from loaded until the promise is resolved' do controller = Volt::ModelController.new(volt_app) promise = Promise.new controller.model = promise expect(controller.loaded?).to eq(false) promise.resolve(Volt::Model.new) expect(controller.loaded?).to eq(true) end end end
Version data entries
9 entries across 9 versions & 1 rubygems