Data dodania Pytanie
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
2017-07-21 18:07 rails5 rspec request.cookies vs response.cookies vs cookies »
In an rspec test you have access to cookies, request.cookies, and response.cookies. What is the difference between the three variables and when should...
(0) odpowiedzi
2017-07-21 17:07 Rspec not finding class methods »
I'm writing some tests for my backend jobs and I'm having a weird issue with rspec not finding my methods. I wrote a simple class & test to illus...
(2) odpowiedzi
2017-07-21 16:07 Which style of assertion with Capybara and SitePrism? »
I am using the PageObject pattern, which abstracts HTML details away from the top-level of the test. I am doing this using the SitePrism gem. In my ...
(1) odpowiedzi
2017-07-20 09:07 How to test receipt of the same method with different arguments on different instances »
I have my method like def my_method MyClass.new.track(arg1, arg2) if satisfies_some_condition 2.times { MyClass.new.track(arg3, arg4) } en...
(1) odpowiedzi
2017-07-20 03:07 Rspec ArgumentError, object not defined »
Why am I getting the error below? When running a rspec test in console, I get the error that 'post' is unknown. yet the line of code that is failing i...
(1) odpowiedzi
2017-07-20 02:07 Adding `after` block in rspec helper module »
I've got a module of helpers which is include'd in an RSpec.describe block. Most methods in there are related to managing logged in / logged out statu...
(2) odpowiedzi
2017-07-19 23:07 How do you test a file generator in a rails 5 gem with rspec »
I'm completely new to testing, but I want to learn and I am having trouble with using Rspec to test a gem I created. The gem just creates a new folder...
(0) odpowiedzi
2017-07-19 20:07 Testing sign up and sign in with Capybara (Rails, RSpec, Devise) »
I wrote the following feature spec to test sign up, sign in, password recovery, and account locking behavior in a Rails 4.2.8 application with Devise....
(1) odpowiedzi
2017-07-19 02:07 routing to nested rails route »
I'm trying to create an rspec to route to a nested resource but I keep getting a No route matches error. 1) V1::DevicesController scan submitted to #...
(1) odpowiedzi