Guard doesnt see the changes in the spec files?


#1

I am doing some simple rspec testing.

I have a model spec file

require 'rails_helper'

RSpec.describe User, type: :model do
  
  
  it 'creates user' do
      User.create(email: 'asd@we.com', password: 'asasdasdasd', admin: true, firstname: 'asdasdasd', lastname: 'wer', grade: 5, section: 'w', role: 'studedsfnts')
      expect(User.count).to eq(5)
  end
  
  # it 'should not have password attribute' do
  #     User.create(email: 'asd@we.com', password: 'asdasdasd', admin: true, firstname: 'qwe', lastname: 'wer', grade: 5, section: 'w', role: 'qweqwe')
  #     expect(User.first.attributes).to_not include('password')
  # end
  
  # it 'encrypts password' do
  #     User.create(email: 'asd@we.com', password: 'asdasdasd', admin: true, firstname: 'qwe', lastname: 'wer', grade: 5, section: 'w', role: 'erer')
  #     expect(User.first.encrypted_password).to_not eq('asdasdasd')
  # end
  
  
end

When i run all tests using guard or rspec i get the following output

02:45:29 - INFO - Running: spec/models/user_spec.rb
...

Finished in 0.10054 seconds (files took 2.79 seconds to load)
3 examples, 0 failures

As you can see the two examples are commented out so it should be testing 1 example. I think the updated specs file is not being seen by guard or rspec. Is someone else having trouble with rails testing in cloud 9?


#2

Have you solved that? Im with the same problem here


#3

now it is working for me. please make sure you have put which files guard should watch in guard configuration files. rest is up to cloud9 to improve their service so that this issue doesnt happen in future.