Questions tagged [rake-test]

50 questions
2
votes
1 answer

Rake test error - ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError

Everytime I do rake test i get 12 errors all with the same error 8) Error: ProductTest#test_image_url: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError 9)…
2
votes
1 answer

Rake Default namespace runs tests

I'm attempting to run some tests on my rails application, and they're working, which is great. However, I'm noticing that when I just run rake it defaults to running my tests. If anybody has run into this before and can shed some light on why this…
Idyllize
  • 47
  • 1
  • 6
1
vote
0 answers

how to trigger a rake:db:prepare that it also migrates an external database connection

I'm currently trying to perform some tests on a rails app that has two database connections. As of course I wouldn't like to delete the 2nd database each time I perform a test, I have set up a mechanism to connect to another 2nd-DB if the…
fenton
  • 134
  • 6
1
vote
0 answers

test actionview got rake aborted. How to avoid the rake aborted?

I read Contributing to Ruby on Rails — Ruby on Rails Guides about test for rails/rails at 4-2-stable: Ruby on Rails (commit number: e531c86e6bb0b623cd18c97a7a32ba981e8fb2ce) In rails/activerecord directory on my Mac. % RUBYOPT=-W0 bundle exec rake…
shingo.nakanishi
  • 2,045
  • 2
  • 21
  • 55
1
vote
1 answer

Don't know how to build task 'recipe_test.rb'

I know same question is asked before but those were totally different scenarios than mine . I have a .rb file in my rails_app/test/integration recipe_test.rb require "test_helper" class RecipeFlowsTest < ActionDispatch::IntegrationTest fixtures…
Mani
  • 2,391
  • 5
  • 37
  • 81
1
vote
1 answer

I'm getting an undefined method error when running tests on rails 4 with guard

I was happily working along in Hartl's tut (exactly here https://www.railstutorial.org/book/filling_in_the_layout#code-contact_page_test) when I started getting this error in guard and have not been able to find anything to do with any methods or…
Matthew Macri
  • 89
  • 2
  • 14
1
vote
1 answer

Rails Test Failing

I keep getting these errors on terminal whenever i run the following code. rake test or bundle exec rake test /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': cannot load such file --…
drys
  • 13
  • 3
1
vote
1 answer

issue running rake test chapter 7

I am trying to run the rake test on the sample app and I have 1 error that I cannot seem to shift. `ERROR["test_invalid_signup_information", UsersSignupTest, 0.717775303] test_invalid_signup_information#UsersSignupTest (0.72s)ArgumentError: …
1
vote
1 answer

Rails extending `rake test` to incorporate custom behaviour

I've got a bunch of files in test/policies, and I've tried to enhance rake test like so: # lib/tasks/test.rake namespace :test do desc "Test Pundit policies" Rake::TestTask.new(:policies) do |t| t.libs << 'test' t.pattern =…
stephenmurdoch
  • 34,024
  • 29
  • 114
  • 189
1
vote
1 answer

String can't be coerced into Fixnum in TestFirst lesson

I'm working through the TestFirst.org tutorials and have gotten an error message I can't untangle: Failure/Error: repeat("hello").should == "hello hello" TypeError: String can't be coerced into Fixnum # ./03_simon_says/simon_says.rb:13:in `+' …
alightholder
  • 115
  • 8
1
vote
1 answer

Rake task return value for Ruby system() call

I have a Rake task which looks something like the following. What I’m trying to do run a system command, and return its error-value. Before returning I’d like to display a message saying something like “[OK]” or “[FAILED]". With this code, Rake…
Debajit
  • 46,327
  • 33
  • 91
  • 100
1
vote
2 answers

How to skip some test folder when running rake test

I have the following configuration for running tests of a gem: require 'rake/testtask' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = false end inside my test folder I have a…
Konstantin Rudy
  • 2,237
  • 25
  • 22
1
vote
2 answers

How to prevent "rake test" from deleting "rake db:seed" data?

My Ruby version is ruby 1.9.3p385 . My Rails version is 3.2.12. I use the following to load the test database: rake db:seed RAILS_ENV=test Everything works great. All the Factory Girl stuff is loaded nicely. Contents of test/factories.rb…
Nightwolf
  • 4,495
  • 2
  • 21
  • 29
0
votes
1 answer

I'm trying to run a rake test ruby / sinatra and its telling me rake aborted! I'm not sure what to do

Here is the what my terminal is showing me.. user@Users-MacBook-Pro palindrome_app % bundle exec rake test /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mustermann-1.1.1/lib/mustermann.rb:73:in `new': Hash can't be coerced into…
0
votes
2 answers

How can i resolve this- rake:aborted! Mysql2::Error: Access denied for user 'root'@'localhost' (using password: NO)

When i run rake test for default test file i get the access denied error even though i have provided password in my database.yml file. What might be the problem? This is my yml file. My error in terminal default: &default adapter: mysql2 …