Login with remembering tests not failing - railstutorial.org

Normally I'd be happy my tests are passing, but not in this case. I'm going through the tutorial again, making my own app. So I have a few differences with the tutorial code, which are (hopefully) just cosmetic. All the logging in and session stuff should be the same.
After slogging through Section 8.4.2 Login With Remembering, the tests are supposed to fail (listing 8.37), because there's no way to log out. But mine pass.
Does anybody know which test is supposed to fail? I don't know how I will track down a problem without a failure.

I missed the section on logging out. After adding that code, I get an expected failure in "login with valid information followed by logout"
delete logout_path
assert_not is_logged_in?
assert_redirected_to root_url f
ollow_redirect!
assert_select "a[href=?]", login_path <----- fails

Related

Bit.cloud not showing my components tests

Bit.cloud is not showing my tests, but they are right there, and they show when running bit start locally. Sadly, the link on the no tests page directing me to learn how to add tests goes to a 404.
I the workspace is public, have a look and see here, the first link the is "tests" tab showing empty, https://bit.cloud/koodoo/koomeleon/second-charge/validation/~tests, and this link is a test for the the same component https://bit.cloud/koodoo/koomeleon/second-charge/validation/~code/eligibility/dateOfBirth/index.test.ts.
Also, side note, can I get an invite to the Slack workspace please? Again the link on the bit.cloud page goes to a sign-in page for the workspace bit-dev-community, but there is no way of registering or requesting an invite.
Please and thank you in advanced.
Explanation
The reason your tests are not being show is due to its extension.
Tests are configured to use the .spec.ts extension to work.
Solution
Having said so, rename your test to:
vaidation.spec.tsx
and it will work.
edit: forgot to add the 'x' at the end of '.tsx'

unable to locate element with Watir webdriver, Firefox, PayPal sandbox pay with PayPal

I am getting the error
Watir::Exception::UnknownObjectException: unable to locate element, using
{:id=>"submitLogin", :tag_name=>"input"}
from /Users/ktobo/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/
gems/watir-webdriver-0.9.1/lib/watir-webdriver/elements/element.rb:536:in
`assert_element_found'
when running an Rspec test using Watir webdriver with Firefox.
# select "Pay with my PayPal account"
#browser.span(:class, 'buttonAsLink').when_present.click
#browser.text_field(:id, 'login_email').when_present(15).set(hsh[:email])
#browser.text_field(:id, 'login_password').when_present(15).set(hsh[:password])
#browser.input(:id, 'submitLogin').when_present.when_enabled.click
#browser.input(:id, 'continue').when_present.click
If I execute these steps one-by-one in a console, everything's great. When running the test with run.rb, the first click action seems to fail to select the "Pay with my PayPal account" span. I'm not sure why it doesn't fail on that step. If I manually click that link after the failure, I see that the password field is not populated, so something seems to be going awry before the fourth line.
Even with the when_present calls, this is most likely a race condition if it works step by step in irb, but not when run together directly. When debugging it is often useful to put a (long-ish) sleep before the problem step just to see if you are hitting a race condition. If the sleep fixes it, then you know what the problem is and just need to figure out the right thing to wait for before clicking.
Another possibility is that this could be an issue where the browser being in the "active window" in the operating system matters. (Commands should work the same way, regardless, but this isn't always the case).
Additionally, running the test with Chrome to see if you have the same issues is also helpful in troubleshooting.
If none of this works, please update your question with an url or the html you are interacting with.
On a side note, I'm surprised that nesting when_present & when_enabled works. when enabled probably should include present? as a precondition, I'll look into doing that.

facebook app action grammar

I have created a Facebook app to make calls. Well, I'm still having trouble getting the action verified.
I got this message when I tried to submit it for approval:
The action grammar is as follows:
I couldn't find the mistake in the grammar I specified. I read their documentation. I still couldn't figure it out.
Can anyone please advice what I'm doing wrong.
The reason is that your imperative tense is too long.
Change 'make free calls using' to 'call using'

asp.net mvc 2 global.asax.cs being ignored

I was having trouble debugging why a route was throwing a 404 when I was positive I set it up correctly. I made changes, rebuilt, still 404, I did all kinds of crazy stuff to the route but always 404.
then in my frustration I just deleted ALL the routing in global.asax, saved rebuilt and ran. I still got 404...
but the rest of the site didn't break!! how can this be? I thought you had to route paths or nothing would work... even my custom routing still worked. I rebuilt, resaved web.config. I even stopped the website, and even the application pool and even IIS ENIIRELY, then restarted evertyhing...
all my routing still seems to be there!
I even threw a divide by zero and even FORCED an exception to be thrown on Application_Start... none of it changed anything...
what in the holy hell is going on? are my routes being cached somewhere? WHERE?!
Try this post as a start point.
http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx
I had a similar issue that in my head I thought I was accounting for, but it turned out not to be the case. With this, you would see which routes are being loaded, which are being ignored, and ultimately, which route you are matching.
okay this was retarted. it turns out that SOMEHOW, the following line was removed from my csproj file:
<Content Include="Web.config" />
I don't know how it happened or why.. it's dumb and retarted and I'm completely upset that I lost two days of productivity because of it...
but I'm glad it's fixed. thanks for your help!

Selenium test on a GWT app - request not sent to server

I'm writing a selenium test for a GWT app. It uses the mouseover/
mousedown/mouseup approach to click pushbuttons. It clicks the Login
button of my app, which calls up the div containing userid and
password entry fields, and that works just fine. It then enters a userid and
password, then clicks the Submit button for the login form.
If I run it slowly, I can see the button click, but the request never
gets sent to the server (I'm watching the wire).
In fact, if, while the selenium IDE is still open, I manually click
the button, the request is not sent. If I then close the selenium IDE
and click the button, the request goes through fine.
Anybody seen this one? It seems really strange.
Update:
Firebug shows a script error. Apparently, the selenium script has some conflict with the GWT script. Here's the beginning of the error, but the whole thing is quite lengthy:
[Exception... "'com.google.gwt.core.client.JavaScriptException: (TypeError): result is null fileName: chrome://selenium-ide/content/recorder.js lineNumber: 74 stack: ([object XMLHttpRequest],"POST","http://localhost:8080/login",true)#chrome://selenium-ide/content/recorder.js:74 XPC_SJOW_CallWrapper((function (url, windowName, windowFeatures, replaceFlag) {if (self.openCalled) {return self.originalOpen.call(window, url, windowName, windowFeatures, replaceFlag);} else {self.o
Okay, I found the answer. It's a little embarrassing, but it provides the answer and it's funny, too. I'll share the answer so that you can avoid the problem, and perhaps have a laugh at my expense. :)
The answer is that you have to compile to OBF instead of PRETTY. All the associated links are listed below. They fully explain the problem, and how to avoid it.
What's funny about this? Well, as I was going through search, I finally hit upon the first link below. Almost immediately, I realized, or at least had a sneaking suspicion, that I had solved this problem before. Sure enough, the original question was posted in October, and I was the poster. So, I got an answer before, and completely forgot. Ah, well. Hope the answer helps someone, and my comic misfortune brightens your day.
http://clearspace.openqa.org/message/50170
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/5d6a9c448a82b916/af62e5877237b107?lnk=raot
http://code.google.com/p/google-web-toolkit/issues/detail?id=2861
Maybe you could try clickAt or mouseDownAt, they seem to perform a bit differently.