demarches-normaliennes/spec/models/procedure_presentation_spec.rb

20 lines
781 B
Ruby
Raw Normal View History

require 'spec_helper'
describe ProcedurePresentation do
2017-09-27 15:16:07 +02:00
let (:procedure_presentation_id) { ProcedurePresentation.create(
displayed_fields: [
{ "label" => "test1", "table" => "user" }.to_json,
{ "label" => "test2", "table" => "champs" }.to_json],
sort: { "table" => "user","column" => "email","order" => "asc" }.to_json
).id }
let (:procedure_presentation) { ProcedurePresentation.find(procedure_presentation_id) }
describe "#displayed_fields" do
it { expect(procedure_presentation.displayed_fields).to eq([{"label" => "test1", "table" => "user"}, {"label" => "test2", "table" => "champs"}]) }
end
2017-09-27 15:16:07 +02:00
describe "#sort" do
it { expect(procedure_presentation.sort).to eq({ "table" => "user","column" => "email","order" => "asc" }) }
end
end