Data dodania Pytanie
2017-04-09 15:04 Feature test never update view with ajax response »
I have the following feature that I would like to test: post a comment and update my timeline with it. This is done asynchronously. This is my form ...
(0) odpowiedzi
2017-04-09 02:04 Why do database checks not raise errors in rspec, but do raise errors in rails console? »
I'm writing a blog app using rails 5.0.2, ruby 2.4.0, and postgresql 9.6.2. I wrote some tests using Rspec to check that the postgres check constraint...
(0) odpowiedzi
2017-04-08 11:04 Why is an Array in my payload being flattened in Sinatra / Rack::Test? »
I'm trying to test a small Sinatra app using rspec. I want to pass a rather complex payload and am running into issues i do not understand: my payload...
(1) odpowiedzi
2017-04-08 01:04 Rails 4 rspec 3 controller test: session helper module not working for before(:all), works for before(:each) »
I'm building a toy chat application using Rails 4.2.7, and am writing specs for my controllers using rspec 3.5. My Api::ChatroomsController requires ...
(1) odpowiedzi
2017-04-07 15:04 can't run rspec test Ruby on Rails »
I'm trying to run a test from root directory but I just get errors. Terminal screenshot Instead if I run the test form the spec folder I don't get a...
(0) odpowiedzi
2017-04-07 12:04 RSpec testing controllers from models depending on foreign keys »
I'm trying to implement a testing environnement with rspec. When testing controllers, the example resource built do not persist and the 3 create tests...
(0) odpowiedzi
2017-04-07 11:04 Rails RSpec controller test changes second attribute »
I have a controller called "CrossLayerParamtersController". If one specified attribute (donor_layer) is updated. I want the attribute (donor_material)...
(1) odpowiedzi
2017-04-06 23:04 How to properly format RSpec update test »
I am learning how to test controllers in Rails. I have this action in my Posts Controller: def update @post = Post.new(post_params) if @post...
(1) odpowiedzi
2017-04-06 21:04 How to use Capybara with events triggered by a JS template in Rails? »
I have a Rails app where I am trying trigger some javascript when an event is triggered with a .js.erb template that is rendered from a controller via...
(0) odpowiedzi
2017-04-06 15:04 Rspec expect to receive and not return »
How can I expect an object to receive a method call and blacklist some return values in RSpec ? Something like expect(happy_character).to receive(:ho...
(0) odpowiedzi
2017-04-05 16:04 How to run RSpec tdd scenarios on eclipse? »
require 'spec_helper' require 'feature_helper' require 'i18n' require 'yaml' require 'securerandom' scenario 'user successfully logs in & sees My...
(0) odpowiedzi
2017-04-04 19:04 Why Capybara / Rspec can't find the button in Sweet Alert Modal but have_selector return true? »
This is a Rspec feature. given (:send_selector){ 'button.confirm'} feature "when talent has not applied." do given (:apply_button) { find('button[...
(2) odpowiedzi
2017-04-04 03:04 ChefSpec - Stub method inside resource »
Is there a way to stub a method call with a test value? For example, I want get_folder_name to return 'test' during my ChefSpec test directory 'Log_...
(1) odpowiedzi
2017-04-04 01:04 Javascript libraries not loaded in integration tests »
I implemented my integration tests using RSpec, Capybara and the Poltergeist driver. Here is an example: describe "Answer a question", type: :feature...
(2) odpowiedzi
2017-04-03 22:04 How is render_views implemented in RSpec (is it a variable, method)? »
Learning RSpec 3+, and learning that in order to render the template from the controller, you have to write render_views within a example group like s...
(1) odpowiedzi
2017-04-03 15:04 Rspec & Capybara: ActionView::Template::Error: undefined method `' for nil:NilClass »
I know the ActionView::Template::Error: undefined method [] for nil:NilClass is a common error but none of the other pages seem to to answer my issue....
(2) odpowiedzi
2017-04-02 23:04 Rspec error: ActionController::UrlGenerationError: No route matches »
I have been surfing google and this site a ton but cannot get a solution for this error that works. If anyone could help it would be greatly apprecia...
(1) odpowiedzi
2017-04-02 04:04 Test devise after_inactive_sign_up_path_for confirmable redirect »
My devise user is :confirmable, and I want to test that the user is redirected to the devise login page after signing up. It works when I manually tes...
(1) odpowiedzi
2017-04-02 00:04 Is ChefSpec in chef really usable compared to testing with Kitchen »
I had covered recipe code with ChefSpec and after that I have integration testing with Kitchen. To me at the end ChefSpec is not really usable just on...
(2) odpowiedzi
2017-04-01 17:04 Rails 5, RSpec with RackTest - deletion of a record feature test »
I created a very simple Rails 5 demo application that has a bunch of categories (Category model). There is a _category.html.erb partial with a link to...
(1) odpowiedzi
2017-04-01 03:04 How I can use one Rspec expect assertion to be run for every test, without repeating myself? »
I have different functions to write a Rspec tests for. But the problem is, what I try to test here, has same syntax per each function, so I have to co...
(1) odpowiedzi
2017-03-31 20:03 FactoryGirl with belongs_to / has_many association with minimum of 1 association »
The issue I'm having is specific to a relationship with a belongs_to and has_many where the has_many relationship has a requirement of at least one as...
(1) odpowiedzi
2017-03-31 20:03 RSpec: Controller not updating record in test env »
This is kind of a weird question so I'll probably be editing this to fill in some context as needed. I have an RSpec test: it "should update obje...
(1) odpowiedzi
2017-03-31 05:03 rspec stub any_instance with attributes »
I need to stub all instances of a model that have a particular attribute or set of attributes. For example, using ActiveRecord: let(:model1) { Model....
(0) odpowiedzi
2017-03-30 17:03 How to use let variable across example blocks without reinitiating the let block? »
I want to create FactoryGirl object and use across groups without re-initiating let block multiple times. There should be only one user created in Dat...
(2) odpowiedzi
2017-03-30 15:03 RSpec does not find my view helper »
I get this error when I run my test spec/helpers/bikes_helper_spec.rb:3:in `<top (required)>': uninitialized constant BikesHelper (NameError) ...
(1) odpowiedzi
2017-03-30 14:03 How to unit test a "disk full" scenario with Ruby RSpec? »
I need to unit test scenarios like the following: The disk has 1MB free space. I try to copy 2MB of file(s) to the disk. What's the best way to do t...
(2) odpowiedzi
2017-03-29 21:03 output matcher expected block but was not a block »
here is a snippet from my spec: context "Given array [1,2,3] and block {|e| puts e if e == 1}" do subject { Array.new([1,2,3]) } it "prints out 1 a...
(1) odpowiedzi
2017-03-29 18:03 Testing will paginate gem with Rspec/Capybara »
In my application there is an admin part, which is restricted to superadmins (users with a property superadmin: true). I've got a shop list, which I w...
(1) odpowiedzi
2017-03-29 08:03 how to create a fake rails' `request` object to test a gem with rspec »
I am developing a gem, which one of its functions will authenticate the incoming request to the controller, and I want to test it. but I don't know ho...
(1) odpowiedzi
2017-03-28 22:03 Can I get attach_file to work without an ID or class name? »
The markup looks exactly like this: <input type="file"> Is there any way to get attach_file to work with this? In the meantime I've asked a d...
(1) odpowiedzi
2017-03-28 18:03 Rail 5 - Testing the mailer »
I am developing a Rails 5 application which involves sending emails. I have created all emails using the action mailer, and I used rspec and capybara ...
(1) odpowiedzi
2017-03-28 18:03 PG::UndefinedTable while running rspec »
In a nutshell, I have a model spec that passes all tests when run independently, but when run with the rest of my specs it fails and throws this error...
(0) odpowiedzi
2017-03-27 22:03 Trying to run a rspec test file and it can't find it »
I am trying to learn RSpec, and thus starting with a simple calculator program. Confused on how to have the rspec find the file because it keeps say...
(2) odpowiedzi
2017-03-27 17:03 Empty rspec fails when I add this custom validation to my User model »
I have a user model, if I add this custom validation my empty rspec test fails: validate :password_complexity def password_complexity if !passw...
(1) odpowiedzi