Sha256: 1bbc74305a39b16952f38efa965ffec0079187dc211fc61c6fba8f7524389898

Contents?: true

Size: 807 Bytes

Versions: 7

Compression:

Stored size: 807 Bytes

Contents

require 'spec_helper'

describe "dummy values" do

  before(:each) { React::IsomorphicHelpers.load_context }

  it "fetches a dummy value" do
    expect(User.find_by_email("mitch@catprint.com").first_name.to_s.is_a?(String)).to be_truthy
  end

  it "can convert the value to a float" do
    expect(User.find_by_email("mitch@catprint.com").id.to_f.is_a?(Float)).to be_truthy
  end

  it "can convert the value to an int" do
    expect(User.find_by_email("mitch@catprint.com").id.to_i.is_a?(Integer)).to be_truthy
  end

  it "can do math on a value" do
    expect(1 + User.find_by_email("mitch@catprint.com").id).to eq(1)
  end

  xit "can do string things as well" do # can't because of the way strings work in opal
    expect("id: " + User.find_by_email("mitch@catprint.com").id).to eq("id: ")
  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/dummy_value_spec.rb
hyper-mesh-0.5.4 reactive_record_test_app/spec-opal/active-record/dummy_value_spec.rb
hyper-mesh-0.5.3 reactive_record_test_app/spec-opal/active-record/dummy_value_spec.rb
hyper-mesh-0.5.2 reactive_record_test_app/spec-opal/active-record/dummy_value_spec.rb
hyper-mesh-0.5.1 reactive_record_test_app/spec-opal/active-record/dummy_value_spec.rb
hyper-mesh-0.5.0 reactive_record_test_app/spec-opal/active-record/dummy_value_spec.rb
hyper-mesh-0.4.0 reactive_record_test_app/spec-opal/active-record/dummy_value_spec.rb