Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Help with an effective strategy to deal with CORS/redirects?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daniel Doubrovkine  
View profile  
 More options Nov 13 2012, 6:02 pm
From: Daniel Doubrovkine <dbl...@dblock.org>
Date: Tue, 13 Nov 2012 15:02:51 -0800 (PST)
Local: Tues, Nov 13 2012 6:02 pm
Subject: Help with an effective strategy to deal with CORS/redirects?

I have some CORS functionality where we do a POST to another domain and
redirect things around. For example, on http://art.sy we login via
https://artsyapi.com, receive a ticket that grants you a cookie on the
non-secure http://art.sy domain. This way passwords don't travel over a
clear channel.

I'm trying to test some of this with Capybara. Ideally I'd like to be able
to introduce a second host into the tests, for example on my local
environment I have http://localhost:3000 and http://local.art.sy:3000 that
are the same thing. For Capybara I am thinking I can do
http://127.0.0.1:1234 vs. http://localhost:1234.

My questions are:

   1. How do I get the full URL to which to set the redirect before I open
   a browser (I can get current_url, but it's too late then). What does
   Capybara user internally when you do "visit X"?
   2. Is there a better strategy for adding a second URL in the loop that
   serves the same application during a test?

Thanks,
dB.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Patterson  
View profile  
 More options Nov 15 2012, 5:38 am
From: Matt Patterson <m...@reprocessed.org>
Date: Thu, 15 Nov 2012 02:38:26 -0800 (PST)
Local: Thurs, Nov 15 2012 5:38 am
Subject: Re: Help with an effective strategy to deal with CORS/redirects?

On Wednesday, 14 November 2012 00:02:51 UTC+1, Daniel Doubrovkine wrote:
> I'm trying to test some of this with Capybara. Ideally I'd like to be able
> to introduce a second host into the tests, for example on my local
> environment I have http://localhost:3000 and http://local.art.sy:3000that are the same thing. For Capybara I am thinking I can do
> http://127.0.0.1:1234 vs. http://localhost:1234.

> My questions are:

>    1. How do I get the full URL to which to set the redirect before I
>    open a browser (I can get current_url, but it's too late then). What does
>    Capybara user internally when you do "visit X"?

That depends on the driver. For Rack-Test
see lib/capybara/rack_test/driver.rb & lib/capybara/rack_test/browser.rb I
assume if you're trying to test CORS you're using a real browser through
Selenium or Poltergeist. Either way, setting Capybara.app_host =
"http://test.local.artsy:3000/" will work for you for the main URL. If you
use config or environment variables to hold the main and login hosts then
you can set them to special values for your tests, and you'll know what
URLs to expect.

Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »