Skip to content

Commit

Permalink
Refactor conversations controller creation specs
Browse files Browse the repository at this point in the history
closes #7197
  • Loading branch information
svbergerem authored and SuperTux88 committed Nov 18, 2016
1 parent 9bca03d commit 9b72527
Showing 1 changed file with 16 additions and 48 deletions.
64 changes: 16 additions & 48 deletions spec/controllers/conversations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,11 @@
end

it "does not create a conversation" do
count = Conversation.count
post :create, @hash
expect(Conversation.count).to eq(count)
expect { post :create, @hash }.not_to change(Conversation, :count)
end

it "does not create a message" do
count = Message.count
post :create, @hash
expect(Message.count).to eq(count)
expect { post :create, @hash }.not_to change(Message, :count)
end

it "responds with an error message" do
Expand All @@ -227,15 +223,11 @@
end

it "does not create a conversation" do
count = Conversation.count
post :create, @hash
expect(Conversation.count).to eq(count)
expect { post :create, @hash }.not_to change(Conversation, :count)
end

it "does not create a message" do
count = Message.count
post :create, @hash
expect(Message.count).to eq(count)
expect { post :create, @hash }.not_to change(Message, :count)
end

it "responds with an error message" do
Expand All @@ -255,15 +247,11 @@
end

it "does not create a conversation" do
count = Conversation.count
post :create, @hash
expect(Conversation.count).to eq(count)
expect { post :create, @hash }.not_to change(Conversation, :count)
end

it "does not create a message" do
count = Message.count
post :create, @hash
expect(Message.count).to eq(count)
expect { post :create, @hash }.not_to change(Message, :count)
end

it "responds with an error message" do
Expand All @@ -288,15 +276,11 @@
end

it "does not create a conversation" do
count = Conversation.count
post :create, @hash
expect(Conversation.count).to eq(count)
expect { post :create, @hash }.not_to change(Conversation, :count)
end

it "does not create a message" do
count = Message.count
post :create, @hash
expect(Message.count).to eq(count)
expect { post :create, @hash }.not_to change(Message, :count)
end

it "responds with an error message" do
Expand Down Expand Up @@ -385,15 +369,11 @@
end

it "does not create a conversation" do
count = Conversation.count
post :create, @hash
expect(Conversation.count).to eq(count)
expect { post :create, @hash }.not_to change(Conversation, :count)
end

it "does not create a message" do
count = Message.count
post :create, @hash
expect(Message.count).to eq(count)
expect { post :create, @hash }.not_to change(Message, :count)
end

it "responds with an error message" do
Expand All @@ -413,15 +393,11 @@
end

it "does not create a conversation" do
count = Conversation.count
post :create, @hash
expect(Conversation.count).to eq(count)
expect { post :create, @hash }.not_to change(Conversation, :count)
end

it "does not create a message" do
count = Message.count
post :create, @hash
expect(Message.count).to eq(count)
expect { post :create, @hash }.not_to change(Message, :count)
end

it "responds with an error message" do
Expand All @@ -441,15 +417,11 @@
end

it "does not create a conversation" do
count = Conversation.count
post :create, @hash
expect(Conversation.count).to eq(count)
expect { post :create, @hash }.not_to change(Conversation, :count)
end

it "does not create a message" do
count = Message.count
post :create, @hash
expect(Message.count).to eq(count)
expect { post :create, @hash }.not_to change(Message, :count)
end

it "responds with an error message" do
Expand All @@ -471,15 +443,11 @@
end

it "does not create a conversation" do
count = Conversation.count
post :create, @hash
expect(Conversation.count).to eq(count)
expect { post :create, @hash }.not_to change(Conversation, :count)
end

it "does not create a message" do
count = Message.count
post :create, @hash
expect(Message.count).to eq(count)
expect { post :create, @hash }.not_to change(Message, :count)
end

it "responds with an error message" do
Expand Down

0 comments on commit 9b72527

Please sign in to comment.