Questions tagged [rake-test]

50 questions
0
votes
1 answer

Is there any way to run a single test in ruby under spec/features/abc_spec.rb 'header details'?

Is there any way to run a single test in ruby under spec/features/abc_spec.rb 'header details' ? Ex: rake test:features spec/features/abc_spec.rb 'header details'
Rajesh
  • 119
  • 1
  • 8
0
votes
1 answer

Ruby on Rails Rake test - Expected 762146111 to match 762146111

My test fail on: assert_match @post.user_id, @user.id with strange error: Expected 762146111 to match 762146111. I have tried to use with and w/o Integer() in creation and/or on match steps
ChaosPredictor
  • 3,777
  • 1
  • 36
  • 46
0
votes
1 answer

ruby rails test case failing but real app works

So here's a strange problem: When I start my local rails app and browse to http://localhost:3000/static_pages/help I can see the page I created there. However, the test case that I wrote says otherwise. static_pages_controller_test.rb require…
MathKid
  • 1,903
  • 1
  • 21
  • 21
0
votes
1 answer

How to fix win32console message in rake test output?

I'm currently trying to learn Ruby on Rails on Windows 10. I'm following the excellent railstutorial by Michael Hartl. However, I'm getting bugged by the 'gem install win32console' message (and lack of colour) appearing when I run rake test. How can…
Karl Bishop
  • 391
  • 1
  • 14
0
votes
0 answers

rake corrupts development database

When I run rake to run specific/all test(s), it corrupts development database. I verified that db for each environment is different. database.yml postgre_common_config: &postgre_common_config adapter: postgresql encoding: unicode pool: 5 …
Amit Patel
  • 15,609
  • 18
  • 68
  • 106
0
votes
1 answer

When To Use A Particular Rails Environment for Testing?

I am teaching myself Ruby On Rails with Michael Hartl's Book. When it uncovered the use of seeds.rb file, I tested within Development Environment, it Failed. When set to Test Environment, It Succeeded. Why? When will I need to change the environment…
Karan
  • 100
  • 1
  • 2
  • 8
0
votes
2 answers

Rake Test Error - test_should_get new is already defined in UserControllerTest

I am currently on Chapter 6 on RoR tutorials (Hartl's) figuring out modeling users. And, I ran into a problem when I run the rake test - I constantly get an error message shown below: /u$ bundle exec rake test rake aborted! test_should_get_new is…
0
votes
1 answer

Can Rake run each test in a separate Ruby instance?

I have a very simple Rakefile to test a small Ruby gem. It looks like this: Rake::TestTask.new task :default => :test It invokes two tests that define constants with the same name. This results in errors being output by the second test like…
starfry
  • 9,273
  • 7
  • 66
  • 96
0
votes
1 answer

ActiveRecord::StatementInvalid: PG::SyntaxError (Ruby Rake test)

This is making me crazy, i dont know whats the problem here Im doing rake test test/model/user.rb but i dont get whats the problem. UserTest#test_test1: ActiveRecord::StatementInvalid: PG::SyntaxError: Error: error de sintaxis en o cerca de…
Skeitho
  • 113
  • 1
  • 9
0
votes
2 answers

How to test 404 Sinatra::NotFound errors with Rack::Test?

I have an application that raises 404 Sinatra::NotFound errors on production when the route is missing. However, the following test passes: it 'should not raise error' do expect{ get '/unknown_path' }.to_not raise_error end Why don't 404…
B Seven
  • 44,484
  • 66
  • 240
  • 385
0
votes
0 answers

Rails: Any way to pass message from method back to rake?

I'm testing a method written in ruby on rails. The short story is - I'm using the Axlsx gem to create an Excel spreadsheet from ruby. I'd like to test (using Rake) that the add_row method is assigning the style I want to the row. The method returns…
Argus9
  • 1,863
  • 4
  • 26
  • 40
0
votes
2 answers

rake test errors from deleted table column

So i generated a scaffold for my ruby on rails project only to find out that i had added a column i no longer need. i generated a migration and removed the extra column. I then removed the column everywhere it was called in the code. But when i run…
Joe Lloyd
  • 19,471
  • 7
  • 53
  • 81
0
votes
1 answer

Why is this Model test breaking (not failing) when I run 'rake test:models'?

I'm going through Agile Web Development with Rails 4 (beta) and in the Model testing section (iteration B2). Things we're going fine until I added the following code in my test/models/product_test.rb file. It's copy an pasted from the pdf. I'm…
Nikola
  • 817
  • 13
  • 19
0
votes
1 answer

How do I get Rake TestTask to execute a Ruby script before testing?

I have a testing "bootstrap" Ruby script that handles test setup (requires libraries, prepares test variables etc.) and I want the Rake TestTask to run this file before it runs the tests. Is this possible? I know that Rake starts the test in a new…
Hubro
  • 56,214
  • 69
  • 228
  • 381
0
votes
2 answers

How to debug a "TypeError: can't convert nil into String" with the traceback of rake tests?

There are a lot of rake tests failing in a ruby on rails project [1], all with same error (can't convert nil into String), and I don't have any idea why is this happening neither how I should debug it. For example, this is the first tracebak of rake…
Draco
  • 337
  • 1
  • 4
  • 12