spec/groupdocs/questionnaire/page_spec.rb in groupdocs-1.2.11 vs spec/groupdocs/questionnaire/page_spec.rb in groupdocs-1.3.0
- old
+ new
@@ -8,21 +8,21 @@
it { should have_accessor(:number) }
it { should have_accessor(:title) }
describe '#questions=' do
it 'converts each question to GroupDocs::Questionnaire::Question object if hash is passed' do
- subject.questions = [{ field: 'Field1', text: 'Text1', def_answer: 'A1' }]
+ subject.questions = [{ :field => 'Field1', :text => 'Text1', :def_answer => 'A1' }]
questions = subject.questions
questions.should be_an(Array)
questions.each do |question|
question.should be_a(GroupDocs::Questionnaire::Question)
end
end
it 'saves each question if it is GroupDocs::Questionnaire::Question object' do
- question1 = GroupDocs::Questionnaire::Question.new(field: 'field1')
- question2 = GroupDocs::Questionnaire::Question.new(field: 'field2')
+ question1 = GroupDocs::Questionnaire::Question.new(:field => 'field1')
+ question2 = GroupDocs::Questionnaire::Question.new(:field => 'field2')
subject.questions = [question1, question2]
subject.questions.should include(question1)
subject.questions.should include(question2)
end
@@ -33,10 +33,10 @@
end
end
describe '#add_question' do
it 'raises error if question is not GroupDocs::Questionnaire::Page object' do
- -> { subject.add_question('Page') }.should raise_error(ArgumentError)
+ lambda { subject.add_question('Page') }.should raise_error(ArgumentError)
end
it 'saves question' do
question = GroupDocs::Questionnaire::Question.new
subject.add_question(question)