Test if direct flag is being assigned correctly when a question is created
This commit is contained in:
parent
56786ebb38
commit
6d49045368
|
@ -10,6 +10,7 @@ describe Ajax::QuestionController, :ajax_controller, type: :controller do
|
||||||
expect(Question.last.content).to eq(question_content)
|
expect(Question.last.content).to eq(question_content)
|
||||||
expect(Question.last.author_is_anonymous).to be(expected_question_anonymous)
|
expect(Question.last.author_is_anonymous).to be(expected_question_anonymous)
|
||||||
expect(Question.last.user).to eq(expected_question_user)
|
expect(Question.last.user).to eq(expected_question_user)
|
||||||
|
expect(Question.last.direct).to eq(expected_question_direct)
|
||||||
end
|
end
|
||||||
|
|
||||||
if check_for_inbox
|
if check_for_inbox
|
||||||
|
@ -85,6 +86,7 @@ describe Ajax::QuestionController, :ajax_controller, type: :controller do
|
||||||
|
|
||||||
context "when user allows anonymous questions" do
|
context "when user allows anonymous questions" do
|
||||||
let(:user_allows_anonymous_questions) { true }
|
let(:user_allows_anonymous_questions) { true }
|
||||||
|
let(:expected_question_direct) { true }
|
||||||
|
|
||||||
context "when anonymousQuestion is true" do
|
context "when anonymousQuestion is true" do
|
||||||
let(:anonymous_question) { "true" }
|
let(:anonymous_question) { "true" }
|
||||||
|
@ -120,6 +122,7 @@ describe Ajax::QuestionController, :ajax_controller, type: :controller do
|
||||||
context "when anonymousQuestion is false" do
|
context "when anonymousQuestion is false" do
|
||||||
let(:anonymous_question) { "false" }
|
let(:anonymous_question) { "false" }
|
||||||
let(:expected_question_anonymous) { false }
|
let(:expected_question_anonymous) { false }
|
||||||
|
let(:expected_question_direct) { true }
|
||||||
|
|
||||||
include_examples "creates the question"
|
include_examples "creates the question"
|
||||||
end
|
end
|
||||||
|
@ -128,6 +131,7 @@ describe Ajax::QuestionController, :ajax_controller, type: :controller do
|
||||||
|
|
||||||
context "when rcpt is followers" do
|
context "when rcpt is followers" do
|
||||||
let(:rcpt) { "followers" }
|
let(:rcpt) { "followers" }
|
||||||
|
let(:expected_question_direct) { false }
|
||||||
|
|
||||||
context "when anonymousQuestion is true" do
|
context "when anonymousQuestion is true" do
|
||||||
let(:anonymous_question) { "true" }
|
let(:anonymous_question) { "true" }
|
||||||
|
@ -182,6 +186,7 @@ describe Ajax::QuestionController, :ajax_controller, type: :controller do
|
||||||
|
|
||||||
context "when user allows anonymous questions" do
|
context "when user allows anonymous questions" do
|
||||||
let(:user_allows_anonymous_questions) { true }
|
let(:user_allows_anonymous_questions) { true }
|
||||||
|
let(:expected_question_direct) { true }
|
||||||
|
|
||||||
include_examples "creates the question"
|
include_examples "creates the question"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue