in Education by
I'm integrating capybara to a project. At first instance, I just wanted to check what is displaying the login page, so I made this code: require 'acceptance/acceptance_helper' feature 'Login' do scenario 'sign in with right credentials' do visit '/' save_and_open_page end end But when I run the test, it shows me: Failure/Error: visit '/' ActionController::RoutingError: No route matches "/login" # ./spec/acceptance/login_spec.rb:6 If I enter to the application without a valid session, it redirects me (code 302) to a rubycas server to log me in (which has the /login context at start) and after that it redirects me again to my server. What should I do to just view the login page or how to maintain the redirection references in capybara? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I usually do this: Inside my test.rb : require 'casclient' require 'casclient/frameworks/rails/filter' CASClient::Frameworks::Rails::Filter.configure( :cas_base_url => cas_base_url ) Modify your spec like this: CASClient::Frameworks::Rails::Filter.fake(username) visit '/' Let me know if this works for you. ================================================================================== Without using "CASClient::Frameworks::Rails::Filter.fake(username)" I too get the same error. The reason is that cas redirects you to its base url with "/login?service=http%3A%2d%2Fwww.example.com%aF" a parameter like this. And hence it complaints about missing route. Check your test log

Related questions

0 votes
    I have installed and setup RubyCAS-Server and RubyCAS-Client on my machine. Login works perfectly but when ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 30, 2022 in Education by JackTerrance
0 votes
    I have installed and setup RubyCAS-Server and RubyCAS-Client on my machine. Login works perfectly but when ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    Russia is a powerful state on the global stage Do you agree with the view Explain with reasoning? Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    I'm trying to use the mail() function on my computer so I can test the web application's system ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
0 votes
    I am trying to use MVC model to create "update news" page. News has an image and i am using ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    I need to check if url exists and can be reached. In order to do it I send Get request and ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 23, 2022 in Education by JackTerrance
0 votes
    I am getting empty row on following sql SELECT * FROM flyers WHERE fId='6' AND 'userId'='400' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    I want to create a function which will check if it is a correct hour to make an action, but I ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    This question already has an answer here: Pthread_create() incorrect start routine parameter passing (1 answer) ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    i am working on a MVC project in java. For my operation I use database many times. many times my ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I wanted to find a way to extract from the url the classes to be added to the body. I made some ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I wanted to find a way to extract from the url the classes to be added to the body. I made some ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    This question already has an answer here: Pthread_create() incorrect start routine parameter passing (1 answer) ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    This question already has an answer here: Pthread_create() incorrect start routine parameter passing (1 answer) ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have installed Docker Desktop for windows Docker version 18.09.2, build 6247962, and I'm not able ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
...