Skip to content

Commit

Permalink
fix typos,
Browse files Browse the repository at this point in the history
update select spec
  • Loading branch information
jflack-bf committed Sep 12, 2024
1 parent 9bce773 commit e0bec2f
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions spec/active_force/active_query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,33 @@ def self.decorate(records)
context 'when there are no records' do
let(:api_result) { [] }

it 'returns true' do
it 'returns false' do
result = active_query.where("Text_Label = 'foo'").any?
expect(result).to be false
end
end

context 'when records are returned' do
it 'returns false' do
it 'returns true' do
result = active_query.where("Text_Label = 'foo'").any?
expect(result).to be true
end
end
end

describe "select only some field using mappings" do
it "should return a query only with selected field" do
new_query = active_query.select(:field)
expect(new_query.to_s).to eq("SELECT Field__c FROM table_name")
describe "#select" do
context "when passed a block" do
it "should return an array of records" do
result = active_query.select { |record| record.id == '123' }
expect(result).to be_a Array
end
end

context "when passed one or more fields" do
it "should return a query only with selected fields" do
new_query = active_query.select(:field)
expect(new_query.to_s).to eq("SELECT Field__c FROM table_name")
end
end
end

Expand Down

0 comments on commit e0bec2f

Please sign in to comment.