Skip to content

Commit

Permalink
Fix delete with_words logic
Browse files Browse the repository at this point in the history
  • Loading branch information
spiceee committed Jun 17, 2022
1 parent 4c2a23d commit f110b50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/i_delete_my_tweets/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ def can_be_destroyed?(tweet)
if config.with_words.empty?
return false unless bellow_fave_threshold? tweet
return false unless bellow_rt_threshold? tweet
elsif includes_words?(tweet)
return false
end

true
true
else
includes_words?(tweet)
end
end

def collect_with_max_id(collection = [], max_id = nil, &block)
Expand Down
8 changes: 4 additions & 4 deletions spec/i_delete_my_tweets/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
capture_warning do
api.traverse_api!
expect(a_request(:post, match_all_delete_req))
.to have_been_made.times(7)
.to have_not_been_made
end
end

Expand All @@ -131,7 +131,7 @@
capture_warning do
api.traverse_api!
expect(a_request(:post, match_all_delete_req))
.to have_been_made.times(5)
.to have_been_made.times(2)
end
end

Expand All @@ -141,7 +141,7 @@
capture_warning do
api.traverse_api!
expect(a_request(:post, match_all_delete_req))
.to have_been_made.times(5)
.to have_been_made.times(2)
end
end

Expand All @@ -151,7 +151,7 @@
capture_warning do
api.traverse_api!
expect(a_request(:post, match_all_delete_req))
.to have_been_made.times(6)
.to have_been_made.once
end
end
end
Expand Down

0 comments on commit f110b50

Please sign in to comment.