Sha256: f308ddfef8636ca6e61139ba26f0fd745015ec88ebed8751a81b7ecd51c571c9
Contents?: true
Size: 781 Bytes
Versions: 18
Compression:
Stored size: 781 Bytes
Contents
require 'test_helper' class Superstore::Scope::QueryMethodsTest < Superstore::TestCase test "select" do original_issue = Issue.create title: 'foo', description: 'bar' found_issue = Issue.select(:title).find(original_issue.id) assert_equal 'foo', found_issue.title assert_equal original_issue.id, found_issue.id assert_nil found_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 "chaining where with scope" do issue = Issue.create title: 'abc', description: 'def' query = Issue.select(:title).for_key(issue.id) assert_equal [:title], query.select_values end end
Version data entries
18 entries across 18 versions & 1 rubygems