Data dodania Pytanie
2017-08-04 02:08 Can I get RSpec to only run changed specs? »
I have a test suite for a very large project (~ 3800 individual examples) that I'm updating from RSpec 2.14 to 3.6. I have just run a replace-all for...
(2) odpowiedzi
2017-08-03 19:08 rspec How to test if my yield is called »
I need to test that my method is yielding correctly, the implementation is something like def method(val) @attr = yield(val) end I wrote my tes...
(1) odpowiedzi
2017-08-03 17:08 Rspec is calling the original method instead of the mock »
I have an issue with rspec whereby an external object is created from within a method, and instead of using the mock of that object, the actual object...
(0) odpowiedzi
2017-08-03 05:08 Ruby method unable to pass Rspec test »
I am trying to create a method that takes in a user input. It turns that user input into an integer, it then subtracts one from the user input. It als...
(2) odpowiedzi
2017-08-02 21:08 Testing number of successfully returned threads using rspec »
How can I test that the number of successfully returned threads to the main thread is equal to the number of threads created in rspec? ...
(0) odpowiedzi
2017-08-02 18:08 Why is ruby returning `true` for method call? »
So this is a brief tutorial I found abouot Rspec: w3ii.com: rspec on it's explanation about rspec helpers. This is the code for the example: class Do...
(2) odpowiedzi
2017-08-02 12:08 Ruby Returning unexpected nil »
I have a RSpec problem. According to that problem I have written a solution in ruby. But when running with RSpec Where I expect to get a value, I am g...
(1) odpowiedzi
2017-08-01 15:08 RSpec mocking, `name` not available from within an example group »
I have the following Ruby code: def report_deviation(departure) deviation = departure.fetch('Dev') trip = departure.fetch('Trip') run_id = trip...
(1) odpowiedzi
2017-08-01 12:08 Rspec rails api controller index test »
I'm trying to test an api controller action with rspec, but since i am quite new to rspec i can't make it work. I have the following index action: ren...
(1) odpowiedzi
2017-08-01 10:08 How to test initialization values of new action with RSpec? »
In my Ruby on Rails app I have an action copy that copies an invoice and renders its values to the frontend in a new action. It works but I am findi...
(1) odpowiedzi
2017-07-31 21:07 How to include shared context to every spec in rails »
I have a shared context shared_context :current_country do let!(:country) { create :country, slug: "kw" } unless Country.find_by(slug: "kw").presen...
(1) odpowiedzi
2017-07-31 17:07 rails request spec post syntax »
I can't seem to get my head over how to make post requests for testing a url in request spec tests, here's the test code RSpec.describe "Certificati...
(2) odpowiedzi
2017-07-31 09:07 How to escape redirections in rspecs »
I added to me application country separated content. Country sets up from IP address by subdomain in application. before_action :check_domain def c...
(2) odpowiedzi
2017-07-30 19:07 How to run capybara tests on existing session with `debuggerAddress` »
original issue here (maybe someone know answer) I want to use capybara-rspec tests in existing session of chrome (no external chrome, use my chrome, ...
(0) odpowiedzi
2017-07-30 03:07 RSpec-Rails - stub a controller variable »
I have a controller action I want to test: LOG = ApiRequest::Resource::Login def create @response = LOG.new(current_user, params: params).create...
(1) odpowiedzi
2017-07-29 23:07 Rspec controller test failing post #create with association »
I have a customer model that belongs to user, and my controller test for post#create succeeds. But I have a subscription model that belongs to both us...
(1) odpowiedzi
2017-07-28 19:07 How to find a link that has text nested in a div with Capybara? »
I'm trying to find a link in my navbar, nested like so: <div class="menu logged-out" id="loggedoutmenu"> <a href="/users/auth/twitter?stat...
(2) odpowiedzi
2017-07-28 15:07 How to load attributes from a file to chefspec node »
I have the following layout: attributes/default.rb recipes/my_recipe.rb spec/unit/recipes/my_recipe_spec.rb In the attributes files I have a lot of...
(1) odpowiedzi
2017-07-28 00:07 Puffing Billy with Poltergeist error: "rack-test requires a rack application, but none was given" »
Using the Puffing Billy instructions for rspec with capybara I created a simple test to stub a request using the :poltergeist_billy driver resulting i...
(1) odpowiedzi
2017-07-27 17:07 Mocking request timeout in RSpec »
I have a class that makes a request to another service and I want to test error handing around that request. The code looks like this: response =...
(1) odpowiedzi
2017-07-27 12:07 How to fill dynamic form fields using capybara »
I have a form that contains a select box and a text field. The text field is displayed dynamically based on the selectbox selection. If the value of ...
(2) odpowiedzi
2017-07-27 10:07 make put request in rspec properly »
all! I wish to know how to make PUT/PATCH request from RSpec to test Rails 5.1.2 API, like that: describe 'PUT /users/:id' do context '# check ...
(1) odpowiedzi
2017-07-26 22:07 Rspec expect to recieve message with attributes and ignore others »
I'm trying to write a spec for a really long time. I need to test this: expect(Foo).to receive(:bar).with(some_args) and everything would work jus...
(1) odpowiedzi
2017-07-26 21:07 howto properly rails api rspec json test »
I've got UsersController def create @user = User.create(user_params) if @user.save render json: @user, status: :created else render jso...
(1) odpowiedzi
2017-07-26 18:07 Is there any way to test custom pluralization rules using Rspec in rails »
I have added custom pluralization rules for Korean locale and was wondering if there was a way to test this using Rspec.To add custom rules I have add...
(0) odpowiedzi
2017-07-25 18:07 Rails 5 Rspec ActionController::UrlGenerationError »
Searched through other similar questions on here, and they all seem to be related to a malformed request of some sort (Not providing an id, or not inc...
(2) odpowiedzi
2017-07-25 15:07 Ajax Datatables testing with rspec and capybara »
I'm trying to create tests for my app, but I can't make my tests for pages with datatables to work. I'm loading the records to the table with ajax. If...
(0) odpowiedzi
2017-07-25 13:07 Testing dequeuing of Sidekiq jobs »
TLDR; How can I test that a PORO argument for a Sidekiq job serializes and deserializes correctly? Sidekiq provides RSpec matchers for testing that a...
(1) odpowiedzi
2017-07-24 19:07 Testing index view filtering in RSpec feature spec (Capybara) »
The index view of the "users" resource in a Rails 4.2 app is capable of filtering the displayed users by their role (such as in "admin" or "user") and...
(0) odpowiedzi
2017-07-24 18:07 Testing index view sort order in RSpec feature spec (Capybara) »
An index view of a Rails 4.2 app has a table with sort links at its header. If the user clicks the "E-mail" header, records are sorted by E-mail, and ...
(3) odpowiedzi
2017-07-24 00:07 Manual Titleize in Ruby 2.3.3 »
I'm trying to .capitalize all string inputs, excluding small words such as "Of", "The" or "And". I can't figure out why the code isn't working prope...
(1) odpowiedzi
2017-07-23 16:07 Expecting Lambdas in RSpec »
I have a simple class: class Maybe def initialize(value, maybe_klass = Maybe) @value = value @maybe_klass = maybe_klass end attr_reade...
(1) odpowiedzi
2017-07-23 16:07 adding headers to a rspec get »
I am a newbie at rspec - there it's said! I'm trying to pass a jwt token to a get request. I have seen several posts saying that the syntax is: ge...
(1) odpowiedzi
2017-07-22 14:07 Test with rspec and factorygirl not working »
I'm following this tutorial for a rails API but it is a little outdated and some things don't seem to work with newer versions of rails. I'm having a ...
(1) odpowiedzi
2017-07-22 12:07 rspec not loading factory »
I am just getting started on rspec, and I may have included to much in the first go. I followed this guide but cant seem to get it all to come togethe...
(1) odpowiedzi