Files
grecia/spec/models/link_spec.rb
Juan Salvador Pérez García e5f9cf6710 Fixed #239
Proposals dashboard refactored to dashboard.
Added missing specs for the dashboard.
2018-07-24 15:52:43 +02:00

30 lines
544 B
Ruby

require 'rails_helper'
describe Link do
subject do
build :link,
linkable: dashboard_action,
label: label,
url: url,
open_in_new_tab: true
end
let(:dashboard_action) { build :dashboard_action }
let(:label) { Faker::Lorem.sentence }
let(:url) { Faker::Internet.url }
it { should be_valid }
context 'when label is blank' do
let(:label) { '' }
it { should_not be_valid }
end
context 'when url is blank' do
let(:url) { '' }
it { should_not be_valid }
end
end