9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksarequire 'spec_helper'
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksadescribe LogicMappingsController do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:user) { create :user }
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:target_logic) { create :logic, user: user }
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:source_logic) { create :logic, user: user }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa let!(:mapping) do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa create :logic_mapping,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa source: source_logic, target: target_logic, user: user
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'signed in as owner' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa before { sign_in user }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on get to show' do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa before { get :show, id: mapping.to_param, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should respond_with :success }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should render_template :show }
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa it 'does not set the flash' do
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa expect(flash).to be_empty
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on get to new' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :new, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should respond_with :success }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should render_template :new }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on POST to CREATE' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa before do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa post :create, logic_id: source_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa logic_mapping: {
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa source_id: source_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa target_id: target_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa iri: 'http://test.de'
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'create the record' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa let!(:mapping_from_db) { LogicMapping.find_by_iri('http://test.de') }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'should exist' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(mapping_from_db).not_to be(nil)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'should have correct source' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa expect(mapping_from_db.source).to eq(source_logic)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'should have correct target' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa expect(mapping_from_db.target).to eq(target_logic)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on PUT to Update' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa before do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa put :update, logic_id: source_logic.id, id: mapping.to_param,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa logic_mapping: {
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa source_id: source_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa target_id: target_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa iri: 'http://test2.de'
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'change the record' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa let!(:mapping_from_db) { LogicMapping.find_by_iri('http://test2.de') }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'should exist' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(mapping_from_db).not_to be(nil)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'should have correct source' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa expect(mapping_from_db.source).to eq(source_logic)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'should have correct target' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa expect(mapping_from_db.target).to eq(target_logic)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on POST to DELETE' do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa before { delete :destroy, id: mapping.to_param, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'remove the record' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicMapping.find_by_id(mapping.id)).to be(nil)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on GET to EDIT' do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa before { get :edit, id: mapping.to_param, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should respond_with :success }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should render_template :edit }
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa it 'does not set the flash' do
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa expect(flash).to be_empty
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'signed in as not-owner' do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:user2) { create :user }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa before { sign_in user2 }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on get to show' do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa before { get :show, id: mapping.to_param, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should respond_with :success }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should render_template :show }
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa it 'does not set the flash' do
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa expect(flash).to be_empty
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on get to new' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :new, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should respond_with :success }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should render_template :new }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on POST to CREATE' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa before do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa post :create, logic_id: source_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa logic_mapping: {
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa source_id: source_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa target_id: target_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa iri: 'http://test.de'
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'create the record' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa let!(:mapping_from_db) { LogicMapping.find_by_iri('http://test.de') }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'should exist' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(mapping_from_db).not_to be(nil)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'should have correct source' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa expect(mapping_from_db.source).to eq(source_logic)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'should have correct target' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa expect(mapping_from_db.target).to eq(target_logic)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on PUT to Update' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa before do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa put :update, logic_id: source_logic.id, id: mapping.to_param,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa logic_mapping: {
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa source_id: source_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa target_id: target_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa iri: 'http://test2.de'
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'not change the record' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicMapping.find_by_iri('http://test2.de')).to be(nil)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on POST to DELETE' do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa before { delete :destroy, id: mapping.to_param, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'not remove the record' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa expect(LogicMapping.find_by_id(mapping.id)).to eq(mapping)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on GET to EDIT' do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa before { get :edit, id: mapping.to_param, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should respond_with :redirect }
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa it 'sets the flash' do
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa expect(flash[:alert]).to match(/not authorized/)
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'not signed in' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on get to show' do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa before { get :show, id: mapping.to_param, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should respond_with :success }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should render_template :show }
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa it 'does not set the flash' do
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa expect(flash).to be_empty
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on get to new' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :new, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it { should respond_with :redirect }
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa it 'sets the flash' do
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa expect(flash[:alert]).to match(/not authorized/)
7ca38d75d045fade73b81bff6fdf34f4755d75fbEugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on POST to CREATE' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa before do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa post :create, logic_id: source_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa logic_mapping: {
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa source_id: source_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa target_id: target_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa iri: 'http://test.de'
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'not create the record' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicMapping.find_by_iri('http://test.de')).to be(nil)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on PUT to Update' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa before do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa put :update, logic_id: source_logic.id, id: mapping.to_param,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa logic_mapping: {
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa source_id: source_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa target_id: target_logic.id,
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa iri: 'http://test2.de'
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'not change the record' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicMapping.find_by_iri('http://test2.de')).to be(nil)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa context 'on POST to DELETE' do
1d2776811d0d5362a7aaaa09be8c80eb09b3a9e4Eugen Kuksa before { delete :destroy, id: mapping.to_param, logic_id: source_logic.id }
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa it 'not remove the record' do
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa expect(LogicMapping.find_by_id(mapping.id)).to eq(mapping)
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksa end
9721f58c0c6959fae3a048672ad4eacc6a1123e7Eugen Kuksaend