Sha256: 487c5cd69f03e8e907852d1dd5239db1c4654ba7406f0b11e62fcece729a27b1

Contents?: true

Size: 604 Bytes

Versions: 5

Compression:

Stored size: 604 Bytes

Contents

require 'test_helper'

class CassandraObject::Scope::QueryMethodsTest < CassandraObject::TestCase
  test "select" do
    issue = Issue.create title: 'foo', description: 'bar'

    issue = Issue.select(:title).find(issue.id)

    assert_equal 'foo', issue.title
    assert_nil issue.description
  end

  test "select with block" do
    foo_issue = Issue.create title: 'foo'
    bar_issue = Issue.create title: 'bar'

    assert_equal [foo_issue], Issue.select { |issue| issue.title == 'foo' }
  end

  test "select with consistency" do
    Issue.with_consistency 'ONE' do
      Issue.all
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gotime-cassandra_object-4.5.0 test/unit/scope/query_methods_test.rb
gotime-cassandra_object-4.4.5 test/unit/scope/query_methods_test.rb
gotime-cassandra_object-4.4.4 test/unit/scope/query_methods_test.rb
gotime-cassandra_object-4.4.3 test/unit/scope/query_methods_test.rb
gotime-cassandra_object-4.4.0 test/unit/scope/query_methods_test.rb