Seenthis
•
 
Identifiants personnels
  • [mot de passe oublié ?]

 
  • #r
  • #rsp
RSS: #rspec

#rspec

  • @hackernoon
    Hacker Noon @hackernoon CC BY-SA 13/06/2018

    Assigns in #ruby on Rails — How you can test instance variables in views and controllers
    ▻https://hackernoon.com/assigns-in-ruby-on-rails-how-you-can-test-instance-variables-in-views-an

    https://cdn-images-1.medium.com/max/1024/1*s3Nbb7xovm9gmslLChQqwA.png

    Ruby on Rails has special helper methods that allow you to test instance variables in your app’s views and controllers. These are assign and assigns, which stores a hash of the instance variables you can access in your #rspec tests.This tutorial will guide you through how to write a simple controller and view with corresponding tests. These will cover assigning instance variables depending on whether certain conditions are met.How assign and assigns workController testsView testsLearn moreHow assign and assigns worksIf you want to set a controller or view’s instance variables in your RSpec test, then call assign either in a before block or at the start of an example group. The first argument is the name of the instance variable while the second is the value you want to assign to it.before do (...)

    #assigns-in-ruby-on-rails #ruby-on-rails #test-instance-variables

    Hacker Noon @hackernoon CC BY-SA
    Écrire un commentaire
  • @hackernoon
    Hacker Noon @hackernoon CC BY-SA 21/05/2018

    Add badges for TravisCI, Coveralls and Code Climate to your Readme (ruby)
    ▻https://hackernoon.com/add-badges-for-travisci-coveralls-and-code-climate-to-your-readme-ruby-6

    https://cdn-images-1.medium.com/max/1024/1*bo4Wn27LW7IvKIhR20ZuAQ.png

    To monitor your code and show its quality in your #github Readmes you can add badges, such as for Travis CI (to show build status and test reports), Coveralls (code coverage reports), and Code Climate (code quality, a measurement out of 4). As well as seeing the status of your project’s code, clicking on the badges allow users to see detailed reports on these websites.This tutorial shows you how to set up your project with these code reports. As well as this, it includes instructions for adding SimpleCov for code coverage data in your terminal and how to configure #rspec to print out more verbose test reports. This example is for #ruby projects, but can be easily adapted to other languages. My Ruby tic tac toe tech test is one project where I used this setup.PrerequisitesA Github (...)

    #travis-ci #code-coverage

    • #Github
    Hacker Noon @hackernoon CC BY-SA
    Écrire un commentaire
  • @archiloque
    Archiloque @archiloque CC BY 14/05/2015

    capybara-accessible: Automated #accessibility testing in #RSpec and #Rails
    ▻https://github.com/Casecommons/capybara-accessible

    Archiloque @archiloque CC BY
    Écrire un commentaire

Thèmes liés

  • #ruby