Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors/http service encode params #631

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

asheren
Copy link

@asheren asheren commented Dec 29, 2017

This PR is not meant to change any functionality, the goal was simply to refactor the encoded_params method. No new tests were added and no functionality was changed.

Tested back to ruby-2.2.3
There appeared to be test breakage at ruby-2.3 and prior to ruby-2.2, ByeBug breaks, but those breakages seem to be unrelated to this refactor.

  • My PR has tests and they pass!
  • The live tests pass for my changes (LIVE=true rspec -- unrelated failures are okay).
  • The PR is based on the most recent master commit and has no merge conflicts.

In order to decrese the complexity of the method while maintaining functionality,
The `encode_from_param` method was broken in to a separate class with smaller
methods, which should also allow for easier debugging if there is ever an
issue in the future.
Added nodoc to the class since it is already documented in `http_service.rb`
Tested back to ruby-2.2.3
@asheren
Copy link
Author

asheren commented Dec 29, 2017

For sanity sake, here are the tests that failed on master:

Finished in 3 minutes 0 seconds (files took 0.89244 seconds to load)
603 examples, 20 failures, 5 pending

Failed examples:

rspec ./spec/cases/test_users_spec.rb:128 # Koala::Facebook::TestUsers when used without network #create creates a test user when not given installed, ignoring permissions
rspec ./spec/cases/test_users_spec.rb:121 # Koala::Facebook::TestUsers when used without network #create creates a test user when not given installed
rspec ./spec/cases/api_spec.rb[1:13:3:1:1] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with GraphCollection when getting a collection gets a GraphCollection when getting connections
rspec ./spec/cases/api_spec.rb[1:13:2:4] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets multiple objects
rspec ./spec/cases/api_spec.rb[1:13:2:9] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can access connections from public Pages
rspec ./spec/cases/api_spec.rb[1:13:2:18] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can post a message whose attachment has a properties dictionary
rspec ./spec/cases/api_spec.rb[1:13:2:22] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can comment on an object
rspec ./spec/cases/api_spec.rb[1:13:2:7] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets data about 'me'
rspec ./spec/cases/api_spec.rb[1:13:2:11] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can access connections from users
rspec ./spec/cases/api_spec.rb[1:13:2:23] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can verify a comment posted about an object
rspec ./spec/cases/api_spec.rb[1:13:2:21] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can verify a message with an attachment posted to a feed
rspec ./spec/cases/api_spec.rb[1:13:2:15] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can delete likes
rspec ./spec/cases/api_spec.rb[1:13:2:5] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets multiple objects if they're a string
rspec ./spec/cases/api_spec.rb[1:13:2:26] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can get information about an access token
rspec ./spec/cases/api_spec.rb[1:13:2:24] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can like an object
rspec ./spec/cases/api_spec.rb[1:13:2:8] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets multiple objects
rspec ./spec/cases/api_spec.rb[1:13:2:2] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets public data about a Page
rspec ./spec/cases/api_spec.rb[1:13:2:6] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets private data about a user
rspec ./spec/cases/oauth_spec.rb:615 # Koala::Facebook::OAuth for cookie parsing for fetching access tokens protected methods fetches a proper token string from Facebook when asked for the app token
rspec ./spec/cases/realtime_updates_spec.rb:154 # Koala::Facebook::RealtimeUpdates #subscribe in practice sends a subscription request

and here are the ones that failed on this branch:

Finished in 3 minutes 21.5 seconds (files took 0.90898 seconds to load)
603 examples, 20 failures, 5 pending

Failed examples:

rspec ./spec/cases/api_spec.rb[1:13:2:4] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets multiple objects
rspec ./spec/cases/api_spec.rb[1:13:2:18] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can post a message whose attachment has a properties dictionary
rspec ./spec/cases/api_spec.rb[1:13:2:8] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets multiple objects
rspec ./spec/cases/api_spec.rb[1:13:2:15] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can delete likes
rspec ./spec/cases/api_spec.rb[1:13:2:9] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can access connections from public Pages
rspec ./spec/cases/api_spec.rb[1:13:2:24] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can like an object
rspec ./spec/cases/api_spec.rb[1:13:2:7] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets data about 'me'
rspec ./spec/cases/api_spec.rb[1:13:2:2] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets public data about a Page
rspec ./spec/cases/api_spec.rb[1:13:2:6] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets private data about a user
rspec ./spec/cases/api_spec.rb[1:13:2:22] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can comment on an object
rspec ./spec/cases/api_spec.rb[1:13:2:26] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can get information about an access token
rspec ./spec/cases/api_spec.rb[1:13:2:21] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can verify a message with an attachment posted to a feed
rspec ./spec/cases/api_spec.rb[1:13:2:5] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token gets multiple objects if they're a string
rspec ./spec/cases/api_spec.rb[1:13:2:11] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can access connections from users
rspec ./spec/cases/api_spec.rb[1:13:2:23] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with an access token can verify a comment posted about an object
rspec ./spec/cases/api_spec.rb[1:13:3:1:1] # Koala::Facebook::API with an access token it should behave like Koala GraphAPI with GraphCollection when getting a collection gets a GraphCollection when getting connections
rspec ./spec/cases/test_users_spec.rb:128 # Koala::Facebook::TestUsers when used without network #create creates a test user when not given installed, ignoring permissions
rspec ./spec/cases/test_users_spec.rb:121 # Koala::Facebook::TestUsers when used without network #create creates a test user when not given installed
rspec ./spec/cases/oauth_spec.rb:615 # Koala::Facebook::OAuth for cookie parsing for fetching access tokens protected methods fetches a proper token string from Facebook when asked for the app token
rspec ./spec/cases/realtime_updates_spec.rb:154 # Koala::Facebook::RealtimeUpdates #subscribe in practice sends a subscription request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant