Data dodania Pytanie
2017-03-18 16:03 Making a method return a specific value (that would otherwise be random) in Rspec »
I'm trying to write an rspec test that would assume a method will return a specific value when it would normally return a random number between 1 and ...
(1) odpowiedzi
2017-03-17 18:03 Rspec / Capybara clicking on button that was generated using javascript »
I have a generated a button with javascript: <script> var button = document.createElement("button"); button.innerHTML = "Do Something"; ...
(1) odpowiedzi
2017-03-17 17:03 Is there an inverse of it_behaves_like in Rspec? »
Is there something to the effect of 'it_doesnt_behave_like' or 'group_will_fail_with(SomeError)'? I don't see anything in the docs, but I feel like t...
(0) odpowiedzi
2017-03-17 15:03 How to test that a request does not return 500 error? »
I am trying to create an RSpec test which detects if a request can crash the controller, usually a 500 error. So I want to be able to distinguish betw...
(2) odpowiedzi
2017-03-16 22:03 Capybara Unable to find field »
Hello I am doing my very first tests and I would need your help. I am using Rails5. The problem is because of the nested fields I believe...(used Co...
(1) odpowiedzi
2017-03-16 18:03 Weird error when testing a Rails + AngularJS app with Rspec and PhantomJS »
I have an app that lists tickets. It uses AngularJS. Here's the controller action: def index @tickets = apply_scopes(@tickets) response.headers['...
(1) odpowiedzi
2017-03-16 15:03 Rspec - access describe name in describe context, not in `it` »
I have such simplifyed rspec code: require 'rspec' describe 'DescribeTitle' do describe_name = self.class.description p describe_name it 'shou...
(1) odpowiedzi
2017-03-15 17:03 rspec email_spec and jobs.. how does it work? I want to check whether the letter was sent.. and maybe email body »
I have 'controllers/users_controller.rb' def create user = User.new(person_params) if user.save EmailSendJob.perform_later(user.email, 'ra...
(3) odpowiedzi
2017-03-15 12:03 RSpec controller test not raising error »
I just noticed weird Rspec behaviour. I wonder if it's Rspec's error or my approach to testing is incorrect. I have this controller test (I cut out ...
(1) odpowiedzi
2017-03-15 10:03 How to execute all contexts in the defined order in RSPEC »
My _spec structure is something as mentioned below describe do context do end context do end end How I can ensure that ...
(1) odpowiedzi
2017-03-14 23:03 RSpec test not hitting view with render_view »
I am getting this error when using RSpec to test an index action and response in a Rails controller: JSON::ParserError: A JSON text must at...
(1) odpowiedzi
2017-03-14 19:03 Capybara undefined method 'current_scope' »
I have the following code scenario "it should not appears submenus' links if it doesn't has any" do expect(page.find('li.main-category', text: "Sta...
(1) odpowiedzi
2017-03-14 10:03 Getting Nil while testing Controller with Rspec »
I´m trying to test my Controller in Get Index but i always recieve the Error 'got Nil'. This is my code for Spec: require 'rails_helper' describe...
(0) odpowiedzi
2017-03-13 18:03 No Method Error while testing with Rspec in Rails »
I get a No Method Error while Testing with Rspec. Here is my code for the Test: scenario 'admin updates a commissionrate' do create(:assignment, us...
(2) odpowiedzi
2017-03-13 15:03 Capybara::Poltergeist::MouseEventFailed. Poltergeist detected another element »
I am using capybara to test my button click function. require 'spec_helper' describe 'journals edition', js: true do let(:update_button) { find('[...
(1) odpowiedzi
2017-03-13 09:03 RSpec request spec test always returning empty response »
I'm currently putting together a project on Rails (4.1.8) and am trying out writing RSpec request specs to test the api routes. Strangely however it a...
(1) odpowiedzi
2017-03-12 23:03 ruby rails rspec rake resque task spies »
While simple coverage is reporting this as 100% covered I am not satisfied. The spec marked as focus I would like to confirm that all of the Resque m...
(1) odpowiedzi
2017-03-12 23:03 ruby rails rspec rake does not swallow message output »
My spec provides coverage like I had hoped, however, the following 2 messages are displaying in the rspec output: rake resque:scheduler rake environm...
(1) odpowiedzi
2017-03-12 04:03 rails rspec rake task with parameters »
I have been working to get test coverage on the following rake task with the attached spec. However, nothing I appear to try sends the env parameter ...
(1) odpowiedzi
2017-03-11 23:03 After the destruction of the object, the object is still available. rails 5 »
After the destruction of the object, the object is still available. I have a conventional method in the controller in which the object is destroyed. ...
(1) odpowiedzi
2017-03-11 20:03 How to find a css element on the page if it is display: none? »
I'm running automated testing in Ruby. I'm trying to write a script that finds id with display:none (visible only in mobile form), and clicks it. ...
(2) odpowiedzi
2017-03-11 15:03 Having trouble with Rspec. Getting routing error »
I'm working on a group project building a chess application & trying to understand why I am getting a routing error when running this test. I am t...
(1) odpowiedzi
2017-03-10 20:03 How can you stub a method on an OpenStruct? »
I have an rspec test that does the following: enrollment_hash = { checked_dependents: [] } enrollment = OpenStruct.new enrollment_hash ...
(1) odpowiedzi
2017-03-10 14:03 Rails / RSpec: 'allow_any_instance_of' doesn't return multiple values »
I have this code in one of my tests: it 'returns ids when successful' do allow_any_instance_of(Importer).to receive(:import).and_return('12589', '1...
(1) odpowiedzi
2017-03-10 06:03 How to test ActionMailer delivery_method in RSpec? »
I have 2 delivery_methods, switchable using a environment variable like so: config.action_mailer.delivery_method = :mailjet OR config.action_maile...
(2) odpowiedzi
2017-03-09 21:03 Testing controllers of a Rails shopify app »
I have a Rails app created through shopify_app gem and I'm trying to test my controllers using rspec. Since all my controllers inherit from ShopifyApp...
(1) odpowiedzi
2017-03-09 20:03 The controller doesn't get the desired parameter »
Testing the controller. This situation. I make a request to the controller with these parameters. it 'closes selected tickets' do patch :bulk_close...
(0) odpowiedzi
2017-03-09 15:03 RSpec doesn't show full difference between return and expected »
When a run a test with JSON, the rspec doesn't show the full spec, so I can't see the diference between return and expected. The message of diff is s...
(1) odpowiedzi
2017-03-08 23:03 How can a ruby method not repond_to a method but also call the method? »
I'm working with a little method that checks to see if a Tenant has a feature enabled. Each Tenant has a TenantPlan which stores the flags. I also hav...
(1) odpowiedzi
2017-03-08 21:03 What is a good way to integrate RSpec with another language such as Python or C#? »
I wrote a Ruby Gem and other teams in the business will need to implement the same functionality in Python and C#. I would like to run the exiting sp...
(1) odpowiedzi
2017-03-08 14:03 Can't Run a single test when using Zeus Parallel Spec along with Rspec. Focus:true doesn't work »
Rspec provides the handy ability to place focus: true by a test to make it run in isolation. And running $bundle exec rspec spec works to make this ...
(1) odpowiedzi
2017-03-07 21:03 RSpec Expect Hash to include an Array of key value pairs »
Still learning Rspec as a whole, so thanks for patience. Return value is this: { supermodel: { 'id': 1, 'name': 'J', 'model_attributes'...
(3) odpowiedzi
2017-03-07 20:03 Ruby method doesn't get array parameter »
describe Array do describe "#sum" do it "has a #sum method" do expect([]).to respond_to(:sum) end it "should be 0 for an empty ar...
(1) odpowiedzi
2017-03-07 18:03 RSpec ruby parameter »
describe Array do describe "#sum" do it "has a #sum method" do expect([]).to respond_to(:sum) end it "should be 0 for an empty ar...
(2) odpowiedzi
2017-03-06 17:03 How best to test class that depends on constants in another file? »
I'm writing a Ruby library - call it module MyLibrary - which depends upon a data parser. The parser is specific to the library, but may need to be sw...
(2) odpowiedzi