FEATURE: add help text for no bookmarks in user page

This commit is contained in:
Sam
2016-11-29 17:55:39 +11:00
parent efe24f7cc6
commit 266322ce2e
8 changed files with 74 additions and 7 deletions

View File

@ -24,6 +24,28 @@ describe UserActionsController do
expect(action["post_number"]).to eq(1)
end
it 'renders help text if provided for self' do
logged_in = log_in
xhr :get, :index, filter: UserAction::LIKE, username: logged_in.username, no_results_help_key: "user_activity.no_bookmarks"
expect(response.status).to eq(200)
parsed = JSON.parse(response.body)
expect(parsed["no_results_help"]).to eq(I18n.t("user_activity.no_bookmarks.self"))
end
it 'renders help text for others' do
user = Fabricate(:user)
xhr :get, :index, filter: UserAction::LIKE, username: user.username, no_results_help_key: "user_activity.no_bookmarks"
expect(response.status).to eq(200)
parsed = JSON.parse(response.body)
expect(parsed["no_results_help"]).to eq(I18n.t("user_activity.no_bookmarks.other"))
end
context "queued posts" do
context "without access" do
let(:user) { Fabricate(:user) }