Skip to content

Add documentation and feature test on headers setup in controller spec #2229

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

Merged
merged 6 commits into from
Jan 11, 2020

Conversation

benoittgt
Copy link
Member

Hello

This is the answer to #1655 (comment)
Feel free to comment on any wording issue. I will be happy to do correction.

I will be very happy to close this old issue.

Close: #1655

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

@JonRowe JonRowe left a comment

Choose a reason for hiding this comment

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

Looking good I mostly have grammatical tweaks here, might have to preview it on relish to check it renders ok

@benoittgt
Copy link
Member Author

might have to preview it on relish to check it renders ok

@JonRowe I don't have any Relish credentials for the staging env. I tried:

$ relish push rspec-staging/rspec-rails                                                                    

@JonRowe
Copy link
Member

JonRowe commented Dec 14, 2019

Aha turns out neither do ! @myronmarston / @penelopezone ?

@myronmarston
Copy link
Member

Aha turns out neither do ! @myronmarston / @penelopezone ?

I don't have access to rspec-staging/rspec-rails, either:

image

I went ahead and granted @JonRowe access to the other rspec-staging projects, though.

@benoittgt I tried granting you access but relish tells me there's no user with the email address I have for you. I trust @JonRowe can grant you access to the various projects when you work out what email address you use for your relish user.

BTW, bear in mind that there's nothing special about rspec-staging: y'all could create staging-rspec or some other project for this purpose if you can't get access to rspec-staging.

Anyhow, un-subbing from this thread. Hard for me to find time to work on things like this these days.

@JonRowe
Copy link
Member

JonRowe commented Dec 17, 2019

Thanks Myron (not @'d so he's not pinged but if he reads this, thank you!)

@benoittgt it seems there is no staging project for rspec-rails, @mattwynne are you able to help here? I know new projects are turned off which might be why I can't create a staging project for rspec-rails?

@mattwynne
Copy link

If new projects are turned off I'd forgotten about that. I thought we'd just disabled sign-ups.

If that's really the case I can probably do something for you via the rails console. What exactly do you need done?

@JonRowe
Copy link
Member

JonRowe commented Dec 17, 2019

@mattwynne well I can't run relish projects:add rspec-staging/rspec-rails I sort of assumed that was related to the sunset, my apologies if not as the project seems not to exist

@benoittgt benoittgt force-pushed the request-header-doc branch 2 times, most recently from be4e2c1 to fdd97dd Compare December 20, 2019 13:09
@mattwynne
Copy link

@mattwynne well I can't run relish projects:add rspec-staging/rspec-rails I sort of assumed that was related to the sunset, my apologies if not as the project seems not to exist.

@JonRowe that's odd, it works for me (with a different org / project). Do you see an error?

@JonRowe
Copy link
Member

JonRowe commented Dec 24, 2019

@JonRowe that's odd, it works for me (with a different org / project). Do you see an error?

It tells me that I'm not a collaborator on the organisation, which I am? and there appears to be no project there, I guess its possible theres an empty one someone created?

@pirj
Copy link
Member

pirj commented Jan 8, 2020

@mattwynne Did you have a chance to look at this?

@mattwynne
Copy link

mattwynne commented Jan 9, 2020

Thanks for the nudge @pirj.

@JonRowe I checked in the console. I think the problem was that you weren't, in fact, a member of the rspec-staging org, just the projects beneath it. So only Myron (who created the org) had permission to create new projects.

I've added you as a member of the org now @JonRowe so can you try again?

@JonRowe
Copy link
Member

JonRowe commented Jan 9, 2020

Yep that works, thanks @mattwynne! @benoittgt what is your relish username or email?

@benoittgt benoittgt closed this Jan 9, 2020
@benoittgt benoittgt reopened this Jan 9, 2020
@benoittgt
Copy link
Member Author

benoittgt commented Jan 9, 2020

Oups sorry.

I don't have any, and registrations are close. If I can have an account with *** it will be perfect.

@benoittgt
Copy link
Member Author

Thanks @mattwynne for the invit. Sadly when I click on the link I get redirected to this page http://relishapp.com/users/sign_up (I have extra param with invite_code)

@mattwynne
Copy link

Gah.

I created you an account with a random password @benoittgt. Can you try using the password reset password form now?

@benoittgt
Copy link
Member Author

Thanks @mattwynne. I just did it. @JonRowe you should be able to find me. Username "benoit", email "benoit @t hopsandfork dot com"

@mattwynne
Copy link

Great stuff, and props to you and the team for maintaining this exemplary suite of living docs for so many years!

@JonRowe
Copy link
Member

JonRowe commented Jan 9, 2020

Done @benoittgt, you should have access to them all

@benoittgt
Copy link
Member Author

Not super happy with how sentences are splited. See:

But otherwise I think it could be merged.

@pirj
Copy link
Member

pirj commented Jan 9, 2020

Looks like a bug - a newline is turned into a <br/>, I'll open a ticket for yard.

@JonRowe
Copy link
Member

JonRowe commented Jan 10, 2020

@benoittgt @pirj thats normal, its just how relish renders, the lines in features need to be longer to allow them to wrap on relish IIRC

@pirj
Copy link
Member

pirj commented Jan 10, 2020

Awesome, let's merge then and address wrapped lines later.

@JonRowe
Copy link
Member

JonRowe commented Jan 10, 2020

@pirj might as well fix it here as this PR is a documentation PR...

@benoittgt
Copy link
Member Author

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks.

We recommend you to switch to request specs instead of controller specs if you want to set
headers in your call.
If you still want to set headers in controller specs, you can use `request.headers` as
mentioned bellow.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe also keep it as once sentence per line?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about it but the lines were pretty long in code. I push to staging then cut the line in the core where Relish was wrapping lines. :)

@pirj
Copy link
Member

pirj commented Jan 10, 2020

I'm taking care of CI failures - rack 2.1.0 has been released with a deprecation message, and rails is not patched yet to use the new API.

Copy link
Member

@JonRowe JonRowe left a comment

Choose a reason for hiding this comment

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

Looking good, some grammatical tweaks having seen it on the HTML page.

@benoittgt
Copy link
Member Author

I just pushed on staging. Looks better with your review @JonRowe

Capture d’écran 2020-01-11 à 00 02 08


Capture d’écran 2020-01-11 à 00 01 58

@pirj pirj force-pushed the request-header-doc branch from af44f0a to fd14c8a Compare January 11, 2020 10:37
@benoittgt benoittgt merged commit 0362190 into master Jan 11, 2020
@benoittgt benoittgt deleted the request-header-doc branch January 11, 2020 13:27
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.

Rails 5 / Rspec 3.5.0 -- setting request headers?
5 participants