From 6bb8ac7e1f1c7894a2e537938b9a87d47ce089aa Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Fri, 18 Dec 2015 09:33:16 +0800 Subject: [PATCH] fix dumb errors - only 2 topic specs fail now --- spec/models/map_spec.rb | 14 +++++++------- spec/models/synapse_spec.rb | 14 +++++++------- spec/models/topic_spec.rb | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/spec/models/map_spec.rb b/spec/models/map_spec.rb index ec251d53..29185753 100644 --- a/spec/models/map_spec.rb +++ b/spec/models/map_spec.rb @@ -20,19 +20,19 @@ RSpec.describe Map, type: :model do end it 'prevents visibility if private' do - expect(map.authorize_to_show(other_user)).to eq true - expect(map.authorize_to_show(owner)).to eq true - expect(private_map.authorize_to_show(owner)).to eq true + expect(map.authorize_to_show(other_user)).to eq map + expect(map.authorize_to_show(owner)).to eq map + expect(private_map.authorize_to_show(owner)).to eq private_map expect(private_map.authorize_to_show(other_user)).to eq false end it 'only allows editing if commons or owned' do - expect(map.authorize_to_edit(other_user)).to eq true - expect(map.authorize_to_edit(owner)).to eq true + expect(map.authorize_to_edit(other_user)).to eq map + expect(map.authorize_to_edit(owner)).to eq map expect(private_map.authorize_to_edit(other_user)).to eq false - expect(private_map.authorize_to_edit(owner)).to eq true + expect(private_map.authorize_to_edit(owner)).to eq private_map expect(public_map.authorize_to_edit(other_user)).to eq false - expect(public_map.authorize_to_edit(owner)).to eq true + expect(public_map.authorize_to_edit(owner)).to eq public_map end end end diff --git a/spec/models/synapse_spec.rb b/spec/models/synapse_spec.rb index f42427b8..51a23647 100644 --- a/spec/models/synapse_spec.rb +++ b/spec/models/synapse_spec.rb @@ -24,19 +24,19 @@ RSpec.describe Synapse, type: :model do end it 'prevents visibility if private' do - expect(synapse.authorize_to_show(other_user)).to eq true - expect(synapse.authorize_to_show(owner)).to eq true - expect(private_synapse.authorize_to_show(owner)).to eq true + expect(synapse.authorize_to_show(other_user)).to eq synapse + expect(synapse.authorize_to_show(owner)).to eq synapse + expect(private_synapse.authorize_to_show(owner)).to eq private_synapse expect(private_synapse.authorize_to_show(other_user)).to eq false end it 'only allows editing if commons or owned' do - expect(synapse.authorize_to_edit(other_user)).to eq true - expect(synapse.authorize_to_edit(owner)).to eq true + expect(synapse.authorize_to_edit(other_user)).to eq synapse + expect(synapse.authorize_to_edit(owner)).to eq synapse expect(private_synapse.authorize_to_edit(other_user)).to eq false - expect(private_synapse.authorize_to_edit(owner)).to eq true + expect(private_synapse.authorize_to_edit(owner)).to eq private_synapse expect(public_synapse.authorize_to_edit(other_user)).to eq false - expect(public_synapse.authorize_to_edit(owner)).to eq true + expect(public_synapse.authorize_to_edit(owner)).to eq public_synapse end end end diff --git a/spec/models/topic_spec.rb b/spec/models/topic_spec.rb index 4c4ce31d..45d47770 100644 --- a/spec/models/topic_spec.rb +++ b/spec/models/topic_spec.rb @@ -63,19 +63,19 @@ RSpec.describe Topic, type: :model do end it 'prevents visibility if private' do - expect(topic.authorize_to_show(other_user)).to eq true - expect(topic.authorize_to_show(owner)).to eq true - expect(private_topic.authorize_to_show(owner)).to eq true + expect(topic.authorize_to_show(other_user)).to eq topic + expect(topic.authorize_to_show(owner)).to eq topic + expect(private_topic.authorize_to_show(owner)).to eq private_topic expect(private_topic.authorize_to_show(other_user)).to eq false end it 'only allows editing if commons or owned' do - expect(topic.authorize_to_edit(other_user)).to eq true - expect(topic.authorize_to_edit(owner)).to eq true + expect(topic.authorize_to_edit(other_user)).to eq topic + expect(topic.authorize_to_edit(owner)).to eq topic expect(private_topic.authorize_to_edit(other_user)).to eq false - expect(private_topic.authorize_to_edit(owner)).to eq true + expect(private_topic.authorize_to_edit(owner)).to eq private_topic expect(public_topic.authorize_to_edit(other_user)).to eq false - expect(public_topic.authorize_to_edit(owner)).to eq true + expect(public_topic.authorize_to_edit(owner)).to eq public_topic end end end