DEV Community

Discussion on: Daily Hacktoberfest Miscellaneous discussion (October 1st)

Collapse
 
amorpheuz profile image
Yash Dave

I am new to ruby and was recently asked (politely) to write some specs for an issue I am working on. From what I have understood until now, it looks like the file is written using RSpec-Rails. It would be lovely if anyone can suggest any beginner-friendly guides to the same for self-learning!

Bug/fixes links without http(s) #4155

Amorpheuz avatar
Amorpheuz commented on Sep 30, 2019

What type of PR is this? (check all applicable)

  • [ ] Refactor
  • [ ] Feature
  • [x] Bug Fix
  • [ ] Documentation Update

Description

Fix invalid links in article/comments due to absence of http/https

  • updates app>lin>redcarpet>render>html_rouge.rb
  • checks if a link added to article or comment by author contains https:// or http:// or is nil.
    • If true keeps link as is.
    • If false appends // to the link in order to prevent it from appending to dev.to's url.

Related Tickets & Documents

#4101

Added to documentation?

  • [ ] docs.dev.to
  • [ ] readme
  • [x] no documentation needed

[optional] What gif best describes this PR or how it makes you feel?

Figured out a way to test WSL changes via travis 🎉. After ditching a previous branch, hehe. yay!

Collapse
 
downey profile image
Tim Downey

RSpec is just a testing framework so if you're familiar with unit testing in another language you should find it pretty comparable once you get past the BDD syntax.

Some helpful resources:

If you haven't done much unit testing I'd recommend looking up "TDD and Rails".

Cheers!