Module: InfinumJsonApiSetup::RSpec::Matchers

Defined in:
lib/infinum_json_api_setup/rspec/matchers/have_empty_data.rb,
lib/infinum_json_api_setup/rspec/matchers/util/body_parser.rb,
lib/infinum_json_api_setup/rspec/matchers/json_body_matcher.rb,
lib/infinum_json_api_setup/rspec/matchers/have_error_pointer.rb,
lib/infinum_json_api_setup/rspec/matchers/include_error_detail.rb,
lib/infinum_json_api_setup/rspec/matchers/have_resource_count_of.rb,
lib/infinum_json_api_setup/rspec/matchers/include_all_resource_ids.rb,
lib/infinum_json_api_setup/rspec/matchers/include_related_resource.rb,
lib/infinum_json_api_setup/rspec/matchers/include_all_resource_ids_sorted.rb,
lib/infinum_json_api_setup/rspec/matchers/include_all_resource_string_ids.rb

Defined Under Namespace

Modules: Util Classes: HaveEmptyData, HaveErrorPointer, HaveResourceCountOf, IncludeAllResourceIds, IncludeAllResourceIdsSorted, IncludeAllResourceStringIds, IncludeErrorDetail, IncludeRelatedResource, JsonBodyMatcher

Instance Method Summary collapse

Instance Method Details

#have_empty_dataInfinumJsonApiSetup::Rspec::Matchers::HaveEmptyData

Returns:

  • (InfinumJsonApiSetup::Rspec::Matchers::HaveEmptyData)


5
6
7
# File 'lib/infinum_json_api_setup/rspec/matchers/have_empty_data.rb', line 5

def have_empty_data # rubocop:disable Naming/PredicateName
  HaveEmptyData.new
end

#have_error_pointer(pointer) ⇒ InfinumJsonApiSetup::Rspec::Matchers::HaveErrorPointer

Parameters:

  • pointer (String)

Returns:

  • (InfinumJsonApiSetup::Rspec::Matchers::HaveErrorPointer)


6
7
8
# File 'lib/infinum_json_api_setup/rspec/matchers/have_error_pointer.rb', line 6

def have_error_pointer(pointer) # rubocop:disable Naming/PredicateName
  HaveErrorPointer.new(pointer)
end

#have_resource_count_of(expected_count) ⇒ InfinumJsonApiSetup::Rspec::Matchers::HaveResourceCountOf

Parameters:

  • expected_count (Integer)

Returns:

  • (InfinumJsonApiSetup::Rspec::Matchers::HaveResourceCountOf)


6
7
8
# File 'lib/infinum_json_api_setup/rspec/matchers/have_resource_count_of.rb', line 6

def have_resource_count_of(expected_count) # rubocop:disable Naming/PredicateName
  HaveResourceCountOf.new(expected_count)
end

#include_all_resource_ids(required_ids) ⇒ InfinumJsonApiSetup::Rspec::Matchers::IncludeAllResourceIds

Parameters:

  • required_ids (Array<Integer>)

Returns:

  • (InfinumJsonApiSetup::Rspec::Matchers::IncludeAllResourceIds)


6
7
8
# File 'lib/infinum_json_api_setup/rspec/matchers/include_all_resource_ids.rb', line 6

def include_all_resource_ids(required_ids)
  IncludeAllResourceIds.new(required_ids)
end

#include_all_resource_ids_sorted(required_ids) ⇒ InfinumJsonApiSetup::Rspec::Matchers::IncludeAllResourceIdsSorted

Parameters:

  • required_ids (Array<Integer>)

Returns:

  • (InfinumJsonApiSetup::Rspec::Matchers::IncludeAllResourceIdsSorted)


6
7
8
# File 'lib/infinum_json_api_setup/rspec/matchers/include_all_resource_ids_sorted.rb', line 6

def include_all_resource_ids_sorted(required_ids)
  IncludeAllResourceIdsSorted.new(required_ids)
end

#include_all_resource_string_ids(required_ids) ⇒ InfinumJsonApiSetup::Rspec::Matchers::IncludeAllResourceStringIds

Parameters:

  • required_ids (Array<Integer>)

Returns:

  • (InfinumJsonApiSetup::Rspec::Matchers::IncludeAllResourceStringIds)


6
7
8
# File 'lib/infinum_json_api_setup/rspec/matchers/include_all_resource_string_ids.rb', line 6

def include_all_resource_string_ids(required_ids)
  IncludeAllResourceStringIds.new(required_ids)
end

#include_error_detail(error_detail) ⇒ InfinumJsonApiSetup::Rspec::Matchers::IncludeErrorDetail

Parameters:

  • error_detail (String)

Returns:

  • (InfinumJsonApiSetup::Rspec::Matchers::IncludeErrorDetail)


6
7
8
# File 'lib/infinum_json_api_setup/rspec/matchers/include_error_detail.rb', line 6

def include_error_detail(error_detail)
  IncludeErrorDetail.new(error_detail)
end

Parameters:

  • type (String)
  • id (Integer)

Returns:

  • (InfinumJsonApiSetup::Rspec::Matchers::IncludeRelatedResource)


7
8
9
# File 'lib/infinum_json_api_setup/rspec/matchers/include_related_resource.rb', line 7

def include_related_resource(type, id)
  IncludeRelatedResource.new(type, id)
end