Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/nhsd_ods/organisation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ module NhsdOds
# The orgaisation class tests
class OrganisationTest < Minitest::Test
def test_organisation_should_have_model_like_behaviour
url = ODS_ENDPOINT + 'organisations/X26'
file = File.new(RESPONSES_DIR + '/nhsd_ods/organisation_find_success_response.txt')
url = "#{ODS_ENDPOINT}organisations/X26"
file = File.new("#{RESPONSES_DIR}/nhsd_ods/organisation_find_success_response.txt")
stub_request(:get, url).to_return(file)
org = NdrLookup::NhsdOds::Organisation.find('X26')

assert_equal org.name, 'NHS DIGITAL'
end

def test_should_raise_error_if_not_valid_find_method
url = ODS_ENDPOINT + 'organisations'
file = File.new(RESPONSES_DIR + '/nhsd_ods/organisation_all_not_acceptable_response.txt')
url = "#{ODS_ENDPOINT}organisations"
file = File.new("#{RESPONSES_DIR}/nhsd_ods/organisation_all_not_acceptable_response.txt")
stub_request(:get, url).to_return(file)

assert_raises do
NdrLookup::NhsdOds::Organisation.all
NdrLookup::NhsdOds::Organisation.any?
end
end
end
Expand Down