Sha256: d1d63948a758dcb0e96f127cbd0b8f712f6be71baa749f276983d540aba03025
Contents?: true
Size: 922 Bytes
Versions: 37
Compression:
Stored size: 922 Bytes
Contents
RSpec.describe Symphonia::ModelFilters::Base do let(:query) { Symphonia::User.query.new } let!(:user) { FactoryBot.create :user, email: "sample@dummy.cz", status: "active" } describe "string" do subject { Symphonia::ModelFilters::StringFilter.new attribute, query } let(:attribute) { Symphonia::User.registered_attributes[:email] } it "simple filter" do subject.value = "~sample@dummy.cz" expect(subject.apply(Symphonia::User.all).count).to eq 1 end end describe "status" do let(:attribute) { Symphonia::User.registered_attributes[:status] } subject { Symphonia::ModelFilters::SelectFilter.new attribute, query } it "simple filter" do subject.value = "1" expect(subject.apply(Symphonia::User.all).count).to eq 1 end it "array filter" do subject.value = "1|2|3" expect(subject.apply(Symphonia::User.all).count).to eq 1 end end end
Version data entries
37 entries across 37 versions & 1 rubygems