Data dodania Pytanie
2017-11-18 16:11 How to give multiple strings to the Rspec stdout matcher? »
I have some rspec tests to check the output of a command. Previously, I was mocking the entire $stdout.string and I could do this: expect($stdout...
(1) odpowiedzi
2017-11-18 14:11 How to not repeat writing same attributes when using `let` and `create` in nested contexts? »
I have an Rspec test using FactoryBot(FactoryGirl) as follows: describe Note do let(:note) {create(:note, title: "my test title", body: "this is th...
(2) odpowiedzi
2017-11-17 21:11 How can I write a rspec test for change password function? »
This function is used to change user's password with requiring user's old password. So how can I test this function with rspec. def change_password ...
(0) odpowiedzi
2017-11-17 19:11 How to write a rspec test for edit user information function and change password function? »
Does anyone knows how can I write a rspec test for these two functions? The update function is used to allow user to edit their information and update...
(0) odpowiedzi
2017-11-17 19:11 Rspec swallowing Postgres database exception on create »
I have trouble understanding the behavior of Rspec (rspec 3.7, rails 5.1.4) not throwing exceptions (as expected) related to database constraints. As...
(1) odpowiedzi
2017-11-16 16:11 How to check with rspec if a method(e.g. #each) returns an Enumerator when no block is given? »
I defined my_each method in the enumerable_methods.rb. It works the same as #each: when no block is given it returns an Enumerator. In my enumerable_m...
(2) odpowiedzi
2017-11-16 05:11 Rspec: Run specific unit test on every model unless whitelisted »
I have a multi-tenant SaaS app. I run a tenant security test on every tenant model. describe 'tenant security' do it "has only the current company...
(2) odpowiedzi
2017-11-16 00:11 Mocking Rspec any_instance_of method return value relative to instance's actual args »
I'm running into an issue where I'm trying to mock out an async method in a service class, but I want the result set to be based on the inputs to the ...
(1) odpowiedzi
2017-11-15 12:11 ActionCable raising exception during rspec system spec »
I have a problem using ActionCable with system specs using Capybara. ActionCable is working perfectly on my development server, but when testing wit...
(0) odpowiedzi
2017-11-15 11:11 Python equivalent of ruby rspec's "skip" and "pending" »
I'm coming from ruby to python. With ruby's rspec, I am used to using skip and pending to denote tests which should be skipped / cannot currently be e...
(1) odpowiedzi
2017-11-15 01:11 Rspec testing fail strong params »
Trying to get this one to pass for a while, not that familiar with Rspec, tried couple answers, and no luck yet, I have these two parameters being req...
(1) odpowiedzi
2017-11-14 23:11 How do I reference my service class from rspec? »
I'm using Rails 5 and trying to test a service using rspec. I created my "spec" directory per the instructions and placed my test file in there, whic...
(0) odpowiedzi
2017-11-14 22:11 Rails controller testing: Testing in isolation or integration? »
I'm a bit confused when testing Rails controller, whether to test them in isolation(mocking, less DB hits: faster), or in an integration way(no mockin...
(3) odpowiedzi
2017-11-14 20:11 RSpec how to use a_collection_containing_exactly matcher with an array? »
I'd really like to use the a_collection_containing_exactly matcher but with an array in parameters instead of writing values directly, like this cont...
(1) odpowiedzi
2017-11-13 14:11 With rspec+capybara, how to skip running tests if a 'header' smoke test fails? »
I want to run a smoke test "does the page exist with the form I want" before running the other tests in that spec. If the above test fails there is n...
(0) odpowiedzi
2017-11-13 13:11 Rspec check if a method has been called without calling the method »
I am pretty new with RSpec an althought I have been reading a lot about how to check if a method has been called I cannot find a proper solution for t...
(2) odpowiedzi
2017-11-13 06:11 RSpec error: 'but it does not respond to `include?`' »
I am running the following rspec test expect(City.first.city_openings('2014-05-01', '2014-05-05')).to include(@listing2,@listing3) I am getting th...
(1) odpowiedzi
2017-11-12 16:11 RSpec Webmock not working »
Im making this request: https://api.yotpo.com/products/abc123apikey/yotpo_global_reviews/reviews Here is my error: Failure/Error: resp = HTTPar...
(1) odpowiedzi
2017-11-12 05:11 Rails + Rspec: Database cleaner gem is not working »
I need some guidance on how to get database cleaner to work for my rails app. ID of records keep on increasing for each test and is not being wiped ou...
(1) odpowiedzi
2017-11-12 01:11 Stub authentication in request specs »
I'm looking for the way to do this but in request specs. I need to log in and log out a double or instance_double to Devise instead of an actual Activ...
(1) odpowiedzi
2017-11-11 21:11 I've unintentionally created a production database. Will this destroy the production data that already exists? »
Context: I've built a rails app that's in production. Originally, the scope of the project was small so I didn't need to write tests, but as it grows,...
(1) odpowiedzi
2017-11-10 18:11 Doing rspec testing with subdomains »
So I have an app that is heavily dependant on subdomains that are generated with each user. And what I need is to pass the proper subdomain for each t...
(1) odpowiedzi
2017-11-10 15:11 What does Timeout.timeout(0) mean in chef server spec (Ruby) »
I am trying to write server spec code for some service. I want to add the timeout so that if within given time, command doesn't responds, the test cas...
(2) odpowiedzi
2017-11-10 12:11 Can I prevent rspec of running other examples in group if specific one didnt pass? »
I asked it in rspec-core repository (https://github.com/rspec/rspec-core/issues/2477) but after that I thought that it is not the proper place to ask ...
(1) odpowiedzi
2017-11-09 18:11 Rspec with string list argument matcher »
I'm writing an Rspec unit test that's trying to assert that a string passed to a function includes a list of substrings. Specifically, it is of the fo...
(0) odpowiedzi
2017-11-09 13:11 cucumber scenarios and rspec test »
I'm almost finished building my first rails application and now I have to cover it with cucumber scenarios and rspec tests. My knowledge about testing...
(0) odpowiedzi
2017-11-09 09:11 How to write RSpec to check if associated record exists? »
I am newbie to RSpec. I am having a model teacher that has_many :lessons. Here is my FactoryGirls records: spec/factories/lessons.rb FactoryGirl.def...
(1) odpowiedzi
2017-11-08 12:11 Passing an example from "it" block to "let" block in RSpec »
I was watching a codeschool screencast on using RSpec and it had the following lines: describe Game do describe '#call' do let(:description) do...
(1) odpowiedzi
2017-11-08 11:11 publish junit test result report from parent's workspace »
I have a parent job and two child jobs in jenkins. The workspace shared by the child jobs resides within the parent job. Now the child jobs are produc...
(1) odpowiedzi
2017-11-08 08:11 How to test production build of Rails project with same Rpec tests? »
I'm building an JSON API service with Rails and using docker for running it in production. In my Dockerfile I would want to use: RUN bundle install -...
(1) odpowiedzi
2017-11-07 20:11 Why does my rspec matcher not meet my equality error conditions? »
I am getting the following error in my spec, but my errors are identical: expected: (#<MessageStrategySMS::CountryNotSupportedError: The country '...
(0) odpowiedzi
2017-11-07 18:11 Rspec Testing : NoMethodError - undefined method 'id' for nil.Nilclass »
When I am running rspec testing for a controller in Rails, I get the error "NoMethodError : undefined method 'id' for nil.Nilclass" at the second line...
(1) odpowiedzi
2017-11-07 11:11 rails rspec stubbed ActiveRecord::Relation for ActiveRecord Serialize »
can I stub ActiveRecord::Relation for ActiveRecord Serialize !? I could stub ActiveRecord::Relation .. but it doesn't work for ActiveRecord Serialize...
(0) odpowiedzi
2017-11-06 20:11 Rspec: Comment rendered as created by a user different from logged in user »
I'm new to rspec and capybara and learning by slowly expanding my test scenarios. I am unable to understand why a comment which i created after logg...
(1) odpowiedzi
2017-11-06 17:11 Rspec shared context and factory parameters »
I have a lot of specs that need to have authentication contexts. I want to DRY specs and I've created a shared context. And I need to passa some param...
(0) odpowiedzi