Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

feat($http): provide a config object as an argument to header functions #10622

Conversation

pkozlowski-opensource
Copy link
Member

This is a cleaned up / alternative version for #7235

@fundon
Copy link

fundon commented Jan 5, 2015

+1, Nice!

Please merge!

@pkozlowski-opensource
Copy link
Member Author

@caitp / @petebacondarwin / @lgalfaso (or anyone else!) - would you guys mind reviewing this one - it is pretty minimal

@caitp
Copy link
Contributor

caitp commented Jan 9, 2015

taking a quick gander


expect(config.bar).toBeUndefined();
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also test the main functionality of this feature? :p

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caitp it is tested as otherwise a mocked request would fail, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check ngMock one sec... But in spite of that, I think you should have a different spec for that, because it's not explicitly testing that, it's explicitly testing that the passed in config object is a shallow copy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I thought of splitting it into 2 separate specs when I saw your comment. Will create 2 separate specs.

@petebacondarwin
Copy link
Member

Can you guys triage your own PRs please!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@googlebot
Copy link

CLAs look good, thanks!

@pkozlowski-opensource
Copy link
Member Author

I've rebased this one and split tests based on the review comments.
@caitp do you want to have another look at this one?

@caitp
Copy link
Contributor

caitp commented Jan 17, 2015

I'll take a look on Monday

@caitp caitp assigned caitp and unassigned pkozlowski-opensource Jan 17, 2015
$httpBackend.flush();
});

it('should not allow modifications to a config object in header functions', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should ignore modifications (but no big deal)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will also only "ignore" changes to root properties of the config object, so changes to child object properties won't be ignored :( but I don't think it's worth worrying about it until someone complains

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeh... but I agree that we shouldn't worry about it too much right now...

@caitp
Copy link
Contributor

caitp commented Jan 20, 2015

still lgtm

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

Successfully merging this pull request may close these issues.

None yet

5 participants