diff --git a/lib/i_delete_my_tweets/api.rb b/lib/i_delete_my_tweets/api.rb index 96726dc..dd4b0c9 100644 --- a/lib/i_delete_my_tweets/api.rb +++ b/lib/i_delete_my_tweets/api.rb @@ -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) diff --git a/spec/i_delete_my_tweets/api_spec.rb b/spec/i_delete_my_tweets/api_spec.rb index 60b4734..79f2b53 100644 --- a/spec/i_delete_my_tweets/api_spec.rb +++ b/spec/i_delete_my_tweets/api_spec.rb @@ -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 @@ -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 @@ -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 @@ -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