Skip to content

Commit

Permalink
[ci] Add specs for FeedsController#notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Moises Deniz Aleman authored and hennevogel committed Jun 29, 2017
1 parent b6d7f70 commit 40b2080
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/api/spec/controllers/webui/feeds_controller_spec.rb
Expand Up @@ -62,4 +62,28 @@
describe "GET latest_updates" do
skip
end

describe 'GET #notifications' do
let(:user) { create(:confirmed_user) }

context 'with a working token' do
before do
user.create_rss_token
get :notifications, params: { token: user.rss_token.string, format: 'rss' }
end

it { expect(assigns(:notifications)).to eq(user.combined_rss_feed_items) }
it { expect(response).to have_http_status(:success) }
it { is_expected.to render_template("webui/feeds/notifications") }
end

context 'with an invalid token' do
before do
get :notifications, params: { token: 'faken_token', format: 'rss' }
end

it { expect(flash[:error]).to eq("Unknown Token for RSS feed") }
it { is_expected.to redirect_to(root_url) }
end
end
end

0 comments on commit 40b2080

Please sign in to comment.