Sha256: efbe08ffb80148cb928979571f87027940690163d69fcb5a5e54f7c868505a0d
Contents?: true
Size: 710 Bytes
Versions: 10
Compression:
Stored size: 710 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 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 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
10 entries across 10 versions & 1 rubygems