Skip to content

Commit

Permalink
fix some links related specs
Browse files Browse the repository at this point in the history
  • Loading branch information
tinco committed Nov 7, 2024
1 parent 7c2b49e commit 1a9f298
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion spec/conversations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@
stub_request(:delete, "#{base_url}/conversations/#{conversation_id}/links").
with( headers: headers).
to_return(status: 204, body: nil)
frontapp.delete_tag!(conversation_id, data)
frontapp.remove_conversation_links!(conversation_id, data)
end

it "can remove conversation followers by id" do
Expand Down
24 changes: 12 additions & 12 deletions spec/links_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
let(:frontapp) { Frontapp::Client.new(auth_token: auth_token) }
let(:link_id) { "top_55c8c149" }
let(:link_conversations_response) {
%Q{
<<~JSON
{
"_pagination": {},
"_links": {
Expand Down Expand Up @@ -134,10 +134,10 @@
}
]
}
}
JSON
}
let(:links_response) do
%Q{
<<~JSON
{
"_pagination": {
"next": null
Expand Down Expand Up @@ -169,31 +169,31 @@
}
]
}
}
JSON
end
let(:get_link_response) do
%Q{
<<~JSON
{
"_links"=>{"self"=>"https://lending-home.api.frontapp.com/links/top_55c8c149"},
"_links": {"self": "https://lending-home.api.frontapp.com/links/top_55c8c149"},
"id": "top_55c8c149",
"name": "123456",
"type": "web",
"external_url": "https://example.com/something/123456",
"link": "https://example.com/something/123456"
}
}
JSON
end
let(:create_link_response) {
%Q{
let(:create_link_response) do
<<~JSON
{
"_links"=>{"self"=>"https://lending-home.api.frontapp.com/links/top_3ij8h"},
"_links": {"self": "https://lending-home.api.frontapp.com/links/top_3ij8h"},
"id": "top_3ij8h",
"name": "Bla",
"type": "web",
"external_url": "bla.io",
"link": "bla.io"
}
}
JSON
end

it "can get all link conversations" do
Expand Down Expand Up @@ -225,7 +225,7 @@
stub_request(:post, "#{base_url}/links").
with( body: data.to_json,
headers: headers).
to_return(status: 200, body: )
to_return(status: 200, body: create_link_response)
end

it "can update a link name" do
Expand Down
7 changes: 0 additions & 7 deletions spec/topics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,4 @@
}
}
}

it "can get all topic conversations" do
stub_request(:get, "#{base_url}/topics/#{topic_id}/conversations").
with( headers: headers).
to_return(status: 200, body: topic_conversations_response)
frontapp.get_topic_conversations(topic_id)
end
end

0 comments on commit 1a9f298

Please sign in to comment.