Skip to content

Commit

Permalink
feat!: Remove get_profile from Factiva::Monitoring
Browse files Browse the repository at this point in the history
This functionality is already covered by Factiva::Request#profile
  • Loading branch information
DaniPB committed Feb 5, 2025
1 parent efa2eb8 commit fd34aeb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 593 deletions.
9 changes: 0 additions & 9 deletions lib/factiva/monitoring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,6 @@ def remove_association_from_case(case_id:, association_id:)
.value_or { |error| raise RequestError.new(error) }
end

def get_profile(profile_id:)
url = profile_url(profile_id)

# If the request fails auth is reset and the request retried
get(url)
.or { set_auth; get(url) }
.value_or { |error| raise RequestError.new(error) }
end

def get_matches(case_id:, offset: 0, limit: 100, has_alerts: "any", is_match_valid: "any")
url = matches_url(
case_id,
Expand Down
23 changes: 0 additions & 23 deletions spec/factiva/monitoring_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,29 +134,6 @@ module Factiva
end
end

describe "#get_profile" do
let(:response) { subject.get_profile(profile_id: profile_id) }

context "when the profile exists", vcr: "monitoring/get_profile" do
let(:profile_id) { "11666513" }

it "authenticates and returns the profile" do
expect(response["data"]["id"]).to eq("11666513")
expect(response["data"]["type"]).to eq("profiles")
end
end

context "when factiva returns an error", vcr: "monitoring/get_profile_invalid" do
let(:profile_id) { "invalid_id" }

it "raises a Factiva::RequestError" do
expect {
response
}.to raise_error(Factiva::RequestError)
end
end
end

describe "#get_matches" do
let(:sample_data) {
{
Expand Down
274 changes: 0 additions & 274 deletions spec/vcr/monitoring/get_profile.yml

This file was deleted.

Loading

0 comments on commit fd34aeb

Please sign in to comment.