Data dodania Pytanie
2017-11-24 11:11 Rails Neo4j what does mean no member 'ssl' in struct error »
I migrated my Rails 4.2.6 app from Neo4j V7 to V9. After changing some configuration I run the rspec command and all my tests are failing. The error I...
(1) odpowiedzi
2017-11-23 17:11 Playing a cassete whose request is not inside the use_cassete scope using VCR for Rails »
I've built an API (MyAPI) that connects to an external API for authentication (ExAPI). For all the requests to MyAPI where the user needs to be authe...
(1) odpowiedzi
2017-11-23 09:11 Capybara::ElementNotFound: Unable to find visible link »
I'm having trouble with my test for a method which lets an admin user promote other users to admin by the click of "Promote to Admin". It lies in my c...
(2) odpowiedzi
2017-11-22 15:11 Clearing cache in rspec of Sinatra app »
I would like to clear the cache in the middle of one of my specs. Is there an easy way of this being done? Thanks ...
(0) odpowiedzi
2017-11-22 15:11 Mount additional routes in Rails specs »
I want to test 3rd party sites embedding a javascript widget (provided by my Rails app) and submitting forms to an endpoint in my rails app. To do th...
(1) odpowiedzi
2017-11-22 13:11 User#firstname delegated to person.firstname, but person is nil »
I have the following test code: ... let(:person) { create(:person) } ... it 'test the create route' do json_data = '{"data":{"attributes":{"email"...
(1) odpowiedzi
2017-11-22 11:11 Practical way to test controller authentication with rspec »
I'm wondering if there are better ways to write controller request specs than how I currently do it. I'm using the devise gem for authentication. This...
(2) odpowiedzi
2017-11-21 22:11 Rspec test record is within range of dates »
I'm having this scope function inside my model # models/Post.rb def self.filtered (params) unless params[:year].blank? && params[:mont...
(2) odpowiedzi
2017-11-21 19:11 how to show properly using Rspec the Double Quote Mark's " " »
I'm using Rspec and the gem file_validators for testing and I need to put properly the output of the Quote Marks ("txt") like theses: expect(page).to...
(2) odpowiedzi
2017-11-21 02:11 Stuck with Faraday in rspec »
I'm trying to write a test calling an API using Faraday with RSpec. The calling is in the .execute method and it works normally in production, but in ...
(3) odpowiedzi
2017-11-20 13:11 How to stub a model with a validation from external service »
Here we have a Customer model with multiple validations, and one of the validation access an external service to validate if the person exists. And h...
(1) odpowiedzi
2017-11-20 12:11 How to test rake task when arguments are passed »
I am testing rake task when arguments are passed, I am trying to run a rake task like this rake do_something_after_n_number_of_days 30 when I run ...
(1) odpowiedzi
2017-11-20 10:11 RSPEC NoMethodError: helper method calling another controller's action - »
I have a controller file: some_controller.rb: class SomeController < ActionController::Base def get_params # Do something with params ...
(2) odpowiedzi
2017-11-19 09:11 How to handle contradiction between routes? »
My route file: resources :users do ... resources :subscriptions do post 'add', on: :collection put 'pause', on: :member put 'ca...
(1) odpowiedzi
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