let tags controller spec generate offending query for #5228
This commit is contained in:
parent
538d55dbfc
commit
7da6501602
1 changed files with 29 additions and 23 deletions
|
|
@ -47,36 +47,42 @@ describe TagsController, :type => :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'signed in' do
|
context 'with a tagged post' do
|
||||||
before do
|
before do
|
||||||
sign_in :user, alice
|
eve.post(:status_message, text: "#what #yes #hellyes #foo", public: true, to: 'all')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'assigns a Stream::Tag object with the current_user' do
|
context 'signed in' do
|
||||||
get :show, :name => 'yes'
|
before do
|
||||||
expect(assigns[:stream].user).to eq(alice)
|
sign_in :user, alice
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'assigns a Stream::Tag object with the current_user' do
|
||||||
|
get :show, :name => 'yes'
|
||||||
|
expect(assigns[:stream].user).to eq(alice)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'succeeds' do
|
||||||
|
get :show, :name => 'hellyes'
|
||||||
|
expect(response.status).to eq(200)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'succeeds' do
|
context "not signed in" do
|
||||||
get :show, :name => 'hellyes'
|
it 'assigns a Stream::Tag object with no user' do
|
||||||
expect(response.status).to eq(200)
|
get :show, :name => 'yes'
|
||||||
end
|
expect(assigns[:stream].user).to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
context "not signed in" do
|
it 'succeeds' do
|
||||||
it 'assigns a Stream::Tag object with no user' do
|
get :show, :name => 'hellyes'
|
||||||
get :show, :name => 'yes'
|
expect(response.status).to eq(200)
|
||||||
expect(assigns[:stream].user).to be_nil
|
end
|
||||||
end
|
|
||||||
|
|
||||||
it 'succeeds' do
|
it 'succeeds with mobile' do
|
||||||
get :show, :name => 'hellyes'
|
get :show, :name => 'foo', :format => :mobile
|
||||||
expect(response.status).to eq(200)
|
expect(response).to be_success
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'succeeds with mobile' do
|
|
||||||
get :show, :name => 'foo', :format => :mobile
|
|
||||||
expect(response).to be_success
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue