RSpec.describe "EitilWrapper::Scopes" do let(:scopes) { User.singleton_methods(false) } context "for columns of datatype: boolean" do it "should create the scope .{column_name}_true" do expect(scopes).to include(:confirmed_true) end it "should create the scope .{column_name}_false" do expect(scopes).to include(:confirmed_false) end end context "for columns of datatype: date" do it "should create the scope .{column_name}_today" do expect(scopes).to include(:birthday_today) end it "should create the scope .{column_name}_past" do expect(scopes).to include(:birthday_past) end it "should create the scope .{column_name}_future" do expect(scopes).to include(:birthday_future) end it "should create the scope .{column_name}_on_date(date)" do expect(scopes).to include(:birthday_on_date) end it "should create the scope .{column_name}_before_date(date)" do expect(scopes).to include(:birthday_before_date) end it "should create the scope .{column_name}_after_date(date)" do expect(scopes).to include(:birthday_after_date) end it "should create the scope .{column_name}_between_dates(start_date, end_date)" do expect(scopes).to include(:birthday_between_dates) end it "should create the scope .{column_name}_oldest_first" do expect(scopes).to include(:birthday_oldest_first) end it "should create the scope .{column_name}_newest_first" do expect(scopes).to include(:birthday_newest_first) end end context "for columns of datatype: datetime" do it "should create the scope .{column_name}_today" do expect(scopes).to include(:last_sign_in_today) end it "should create the scope .{column_name}_past" do expect(scopes).to include(:last_sign_in_past) end it "should create the scope .{column_name}_future" do expect(scopes).to include(:last_sign_in_future) end it "should create the scope .{column_name}_on_date(date)" do expect(scopes).to include(:last_sign_in_on_date) end it "should create the scope .{column_name}_before_date(date)" do expect(scopes).to include(:last_sign_in_before_date) end it "should create the scope .{column_name}_after_date(date)" do expect(scopes).to include(:last_sign_in_after_date) end it "should create the scope .{column_name}_between_dates(start_date, end_date)" do expect(scopes).to include(:last_sign_in_between_dates) end it "should create the scope .{column_name}_oldest_first" do expect(scopes).to include(:last_sign_in_oldest_first) end it "should create the scope .{column_name}_newest_first" do expect(scopes).to include(:last_sign_in_newest_first) end end context "for columns of datatype: integer" do it "should create the scope .{column_name}_equal_to(number)" do expect(scopes).to include(:age_equal_to) end it "should create the scope .{column_name}_lower_than(number)" do expect(scopes).to include(:age_lower_than) end it "should create the scope .{column_name}_higher_than(number)" do expect(scopes).to include(:age_higher_than) end it "should create the scope .{column_name}_between(min, max)" do expect(scopes).to include(:age_between) end it "should create the scope .{column_name}_ascending" do expect(scopes).to include(:age_ascending) end it "should create the scope .{column_name}_descending" do expect(scopes).to include(:age_descending) end end context "for columns of datatype: float" do it "should create the scope .{column_name}_equal_to(number)" do expect(scopes).to include(:wage_equal_to) end it "should create the scope .{column_name}_lower_than(number)" do expect(scopes).to include(:wage_lower_than) end it "should create the scope .{column_name}_higher_than(number)" do expect(scopes).to include(:wage_higher_than) end it "should create the scope .{column_name}_between(min, max)" do expect(scopes).to include(:wage_between) end it "should create the scope .{column_name}_ascending" do expect(scopes).to include(:wage_ascending) end it "should create the scope .{column_name}_descending" do expect(scopes).to include(:wage_descending) end end end