spec/features/apidoco/documentation_attributes/params_spec.rb in apidoco-1.6.1 vs spec/features/apidoco/documentation_attributes/params_spec.rb in apidoco-1.6.2
- old
+ new
@@ -3,10 +3,12 @@
RSpec.feature 'Document Attributes', type: :feature do
describe 'params', js: true do
context 'when required is true' do
it 'will list the documentation' do
create_json = {
+ name: 'Create Currency',
+ end_point: '/currencies',
published: true,
params: [{
key: "currency['name']",
required: true,
type: "String"
@@ -14,13 +16,13 @@
}
DocumentationBuilder.create(create_json)
visit '/apidoco'
param = create_json[:params][0]
- expect(page).to have_text("#{param[:key]}")
- expect(page).to have_text("required")
- expect(page).to have_text("#{param[:type]}")
+ expect(page).to have_text(param[:key])
+ expect(page).to have_text("REQUIRED")
+ expect(page).to have_text(param[:type].downcase)
end
end
context 'when required is false' do
it 'will list the documentation' do
@@ -34,12 +36,12 @@
}
DocumentationBuilder.create(create_json)
visit '/apidoco'
param = create_json[:params][0]
- expect(page).to have_text("#{param[:key]}")
- expect(page).to have_text("optional")
- expect(page).to have_text("#{param[:type]}")
+ expect(page).to have_text(param[:key])
+ expect(page).to have_text("OPTIONAL")
+ expect(page).to have_text(param[:type].downcase)
end
end
end
end