English 中文(简体)
最低测试和认证的功能测试
原标题:Functional test with Minitest and authentication

I m trying to do functional test but I don t know how to deal with cookies. I m using Ruby and Minitest to do functional test of controllers. But to run tests in controllers, first I need to authenticate. The authentication uses cookies to see if the user is logged or not. The problem is functional tests do not see what is in cookies, than I can t authenticate and then run tests. Does someone give me a tip to resolve this?

thanks Heber

问题回答

我看着同一问题。 在这一点上,我不敢肯定会这样做,但我打算在“<>代码”之前尝试使用“<>代码”进行认证。

为此:

    before do
      get :login
      # fill in and submit
    end

    it "must do stuff" do
      #Test things and hopefully it ll be logged in
    end




相关问题
Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Best browser for testing under Safari Mobile on Linux?

I have an iPhone web app I m producing on a Linux machine. What s the best browser I can use to most closely mimic the feature-limited version of Safari present on the iPhone? (It s a "slimmed down" ...

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed ...

Is there any error checking web app cralwers out there?

Wondering if there was some sort of crawler we could use to test and re-test everything when changes are made to the web app so we know some new change didn t error out any existing pages. Or maybe a ...

热门标签