Questions tagged as 'rspec'

2
answers

How to create a test with RSpec to check the return of users?

This describe below is the default that Rspec creates. I have a hard time working with TDD ( Test Driven Development ) and it is complicated to understand the whole procedure. For example, I need to test that when accessing the index...
asked by 14.01.2014 / 14:31
1
answer

How do I get the exception Mongoid :: Errors :: DocumentNotFound released on Mongoid

To try to do a test similar to this below capture the exception of a nonexistent document expect(Produto.find('57e2bf76ce222fd11258cd4e')).to raise_error(Mongoid::Errors::DocumentNotFound) The exception message being passed is shown, howeve...
asked by 21.09.2016 / 19:34
3
answers

Correct test for model (RSpec)

I created a test to validate my model and want to know if it is correct. describe Article do it "object article create is valid?" do article = Article.create article.title = "Title for Test" article.description = ""...
asked by 30.01.2014 / 14:50
1
answer

Error performing continuous integration test - Travis-CI

For learning purposes I am using the services of Travis-CI to perform integration testing continues on a personal project. When running the test locally all pass, without errors. However, when running on Travis-CI there is this return. lin...
asked by 17.02.2014 / 18:57
1
answer

Tests with rspec - problems with stub and should

Hello. I am new to testing and I have two tests with problems, one of helper and one of model, being: 1) TodosHelper TodosHelper#visibility(todo) when todo is public Failure/Error: before { helper.stub :current_user => current_user } No...
asked by 10.06.2016 / 05:44
0
answers

How to create a Mock in Ruby On Rails (CarrierWave) to simulate sending image to an S3 (Cloudinary)

I've created a project creation system with an image. My images are sent to Cloudinary + CarrierWave. Before the Test did not break because I sent it to the server, however when I joined the Cloudinary the code broke. I think I know what i...
asked by 27.11.2014 / 12:04
0
answers

How to configure the schema_search_path in the test environment?

When I run the rake spec --trace command I have the error a below. It seems to me that rake does not create the schema I want in the test environment because it does not identify my schema configuration in database.yml. I've been researching and...
asked by 24.11.2014 / 12:41
1
answer

rails rspec, error in post: create, params require

I'm starting the rspec tests in RubyOnRails and I'm having a problem testing my controller's create: it "creates lançamento" do post :create, params: attributes_for(:lancamento), format: :js, xhr: true expect(Lancamento.count).to eq(1) end...
asked by 11.04.2017 / 16:33
2
answers

Matcher be_true ruby / rspec

I'm starting to study about ruby / rspec following a book, but I'm not making progress using matcher be_true . The following is the error: BagOfWords#push is possible to put words on it (FAILED - 1) Failures: 1) BagOfWords#push is p...
asked by 22.10.2014 / 02:21
1
answer

RSpec - Testing feature failing because elements are not rendered in test execution

I have a test feature that fails because at the time it runs some HTML elements ( <li data-podcast> ) have not yet been rendered. Does anyone know how I can fix this? RSpec.describe 'Podcasts List', type: :feature do scenario...
asked by 05.08.2017 / 03:31