FIX: Direct link to group activity page results in 400 error.

https://meta.discourse.org/t/following-a-direct-link-to-group-activity-results-in-400-error/81596
This commit is contained in:
Guo Xiang Tan 2018-02-27 13:43:22 +08:00
parent 519026a31f
commit 06891ce51d
2 changed files with 14 additions and 2 deletions

View File

@ -452,8 +452,6 @@ Discourse::Application.routes.draw do
get "posts.rss" => "groups#posts_feed", format: :rss
get "mentions.rss" => "groups#mentions_feed", format: :rss
get 'activity' => "groups#show"
get 'activity/:filter' => "groups#show"
get 'members'
get 'posts'
get 'topics'
@ -469,6 +467,8 @@ Discourse::Application.routes.draw do
end
member do
get 'activity' => "groups#show"
get 'activity/:filter' => "groups#show"
put "members" => "groups#add_members"
delete "members" => "groups#remove_member"
post "request_membership" => "groups#request_membership"

View File

@ -73,6 +73,18 @@ describe GroupsController do
property: 'og:description', content: group.bio_cooked
})
end
describe 'when viewing activity filters' do
it 'should return the right response' do
get "/groups/#{group.name}/activity/posts.json"
expect(response.status).to eq(200)
response_body = JSON.parse(response.body)['basic_group']
expect(response_body["id"]).to eq(group.id)
end
end
end
describe '#mentionable' do