Add tests for `StaticController#linkfilter`
This commit is contained in:
parent
5eb297136b
commit
bc65b42b02
|
@ -18,4 +18,24 @@ describe StaticController, type: :controller do
|
|||
expect(assigns(:users)).to eq(1)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#linkfilter" do
|
||||
context "called without an url" do
|
||||
subject { get :linkfilter }
|
||||
|
||||
it 'should redirect to the root page' do
|
||||
subject
|
||||
expect(response).to redirect_to(root_path)
|
||||
end
|
||||
end
|
||||
|
||||
context "called with an url" do
|
||||
subject { get :linkfilter, params: { url: 'https://google.com' } }
|
||||
|
||||
it 'should show the passed url' do
|
||||
subject
|
||||
expect(assigns(:link)).to eq('https://google.com')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue