← Back to Upcase

Setting Up the App and Initial Test


(Upcase ) #1
How the video lesson works You will code along with Josh as he builds the application. Do what he does, pause the video if you need to catch up or explore something further. Hop into the chat room to ask questions as you have them, or send emails...
This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/setting-up-the-app-and-initial-test

(Julian Locke) #3

Mine was just a little bit slow as well, but my computer is older.

Perhaps you forgot to use the -T flag when you first generated your rails app which could now be causing your test to run slower.

Hope this helps, if you find out another reason why your test are running slow please reply with the answer.


(Younggabrielle) #4

Same here, do you get this warning in bash?
“Warning: You’re using Rubygems 1.8.23 with Spring. Upgrade to at least Rubygems 2.1.0 and run gem pristine --all for better startup performance.”


(Scott Hollinshead) #5

I got that message.

This is what I did:

gem update --system
gem pristine --all

That worked for me.


(Enrique Salceda) #6

Why I’m getting this error

Enriques-MacBook-Air:goldtrex enriquesalceda$ rake
/Users/enriquesalceda/.rbenv/versions/2.2.0/bin/ruby -I/Users/enriquesalceda/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.1/lib:/Users/enriquesalceda/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rspec-support-3.2.2/lib /Users/enriquesalceda/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rspec-core-3.2.1/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
No examples found.


Finished in 0.00046 seconds (files took 0.10208 seconds to load)
0 examples, 0 failures

I’m trying to implement testing on my app, I followed al the steps on the video, and I have a simple test to run. But it’s not working.


(Enrique Salceda) #7

Hi guys,

My bad, I just fixed this problem, there were a few typos.

Thanks.


(Flo Maldonado) #8

deleting my comment- as no longer makes sense.


(Emmanuel Genard) #9

My tests are really slow

The following is just for the smoke tests.

Finished in 0.20353 seconds (files took 4.09 seconds to load)

The only thing I did different was use postgresql as my DB. Could it be slowing me down that much?


(John Turner) #10

Just to note, rake informed me that I was missing schema.rb and that I needed to run rake db:migrate in order to generate it. After I did that, my test passed.

@edgenard, fwiw, postgres is not the problem - I’m running the default sqlite3 and getting comparable run times. I suspect those with blazing test times are on SSD’s with a full pack of memory (+8GB). I’m running with 4GB on HDD.


(Nickolas Kenyeres) #11

Just wanted to mention that the powered by wistia chrome on the video often obscures what is being typed in.


(Dan Rempel) #12

I noticed this as well and quickly realized it was because I use dual monitors and was leaving the cursor on the secondary monitor. If you leave your cursor on the monitor playing the video the Wistia logo and scrub bar will disappear.


(Nickolas Kenyeres) #13

Thanks. That explains it. I was casting it to my TV with Chromecast.


(Armando Godinez) #14

Just like @edgenard my tests are running pretty slow. I’m not using postgres, so I don’t have any clue on why my tests are traking 4 seconds or more to load.

Finished in 0.00204 seconds (files took 4.12 seconds to load)
1 example, 1 failure

(charlieanna) #15

According to Kent, we should not write any production code without seeing a failing test. What made you write the Todo model ? The failing test didnt ask you to do that. How are you making your architecture independent of the framework/UI? Todo is a very small app so tests run fast but if the app is pretty huge. I have tried it and gave up on testing because it was impossible to have my browser go through all the UI elements making the tests very slow.

Junior developers often change the text of the webpage resulting the tests to fail. Can we keep the dependency on the UI to the bare minimum? @joshuaclayton


(Evgeny Fadeev) #16

Hello, which version of rails is this tutorial for? My config files and Gemfile are different
and rake command exits with error.


(Hunter Stevens) #17

@evgenyfadeev

Hi there.

Around 2:44 in the video, you can see the final Gemfile. Rails 4.1.1 is being used. I am using Rails 5.0.2 myself, and whatever versions of RSpec and Capybara that Bundler chose to install (if I didn’t have them before, then the latest).