6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksarequire 'spec_helper'
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksadescribe LogicAdjointsController do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:source) { create(:logic) }
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:target) { create(:logic) }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:mapping) do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa create(:logic_mapping, source: source, target: target)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:user) { create :user }
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:target_logic) { create :logic, user: user }
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:source_logic) { create :logic, user: user }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:mapping) do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa create :logic_mapping,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa source: source_logic, target: target_logic, user: user
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:target_logic2) { create :logic, user: user }
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:source_logic2) { create :logic, user: user }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:mapping2) do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa create :logic_mapping,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa source: source_logic2, target: target_logic2, user: user
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:adjoint) do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa create :logic_adjoint,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa translation: mapping, projection: mapping2, user: user
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'signed in as owner' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa before { sign_in user }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on get to show' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :show, id: adjoint.id, mapping_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it { should respond_with :success }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen 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
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on get to new' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :new, mapping_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it { should respond_with :success }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it { should render_template :new }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on POST to CREATE' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa before do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa post :create, logic_mapping_id: mapping.id, logic_adjoint: {
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa translation_id: mapping.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa projection_id: mapping2.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa iri: 'http://test.de'
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'create the record' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:adjoint_from_db) { LogicAdjoint.find_by_iri('http://test.de') }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'should exist' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(adjoint_from_db).not_to be(nil)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'should have correct translation' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.translation).to eq(mapping)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'should have correct projection' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.projection).to eq(mapping2)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on PUT to Update' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa before do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa put :update, id: adjoint.id, logic_adjoint: {
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa translation_id: mapping.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa projection_id: mapping2.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa iri: 'http://test2.de'
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'change the record' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:adjoint_from_db) { LogicAdjoint.find_by_iri('http://test2.de') }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'should exist' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(adjoint_from_db).not_to be(nil)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'should have correct translation' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.translation).to eq(mapping)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'should have correct projection' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.projection).to eq(mapping2)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on POST to DELETE' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { delete :destroy, id: adjoint.id, mapping_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'remove the record' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicAdjoint.find_by_id(adjoint.id)).to be(nil)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on GET to EDIT' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :edit, id: adjoint.id, mapping_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it { should respond_with :success }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen 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
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'signed in as not-owner' do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:user2) { create :user }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa before { sign_in user2 }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on get to show' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :show, id: adjoint.id, mapping_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it { should respond_with :success }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen 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
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on get to new' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :new, mapping_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it { should respond_with :success }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it { should render_template :new }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on POST to CREATE' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa before do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa post :create, logic_mapping_id: mapping.id, logic_adjoint: {
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa translation_id: mapping.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa projection_id: mapping2.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa iri: 'http://test.de'
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'create the record' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:adjoint_from_db) { LogicAdjoint.find_by_iri('http://test.de') }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'should exist' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(adjoint_from_db).not_to be(nil)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'should have correct translation' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.translation).to eq(mapping)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'should have correct projection' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.projection).to eq(mapping2)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on PUT to Update' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa before do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa put :update, id: adjoint.id, logic_adjoint: {
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa translation_id: mapping.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa projection_id: mapping2.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa iri: "http://test2.de"
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'not change the record' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicAdjoint.find_by_iri('http://test2.de')).to be(nil)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on POST to DELETE' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { delete :destroy, id: adjoint.id, translation_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'not remove the record' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(LogicAdjoint.find_by_id(adjoint.id)).to eq(adjoint)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on GET to EDIT' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :edit, id: adjoint.id, translation_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen 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
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'not signed in' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on get to show' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :show, id: adjoint.id, translation_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it { should respond_with :success }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen 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
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on get to new' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :new, translation_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen 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
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on POST to CREATE' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa before do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa post :create, logic_mapping_id: mapping.id, logic_adjoint: {
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa translation_id: mapping.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa projection_id: mapping2.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa iri: 'http://test.de'
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'not create the record' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicAdjoint.find_by_iri("http://test.de")).to be(nil)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on PUT to Update' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa before do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa put :update, id: adjoint.id, logic_adjoint: {
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa translation_id: mapping.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa projection_id: mapping2.id,
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa iri: 'http://test2.de'
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'not change the record' do
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicAdjoint.find_by_iri('http://test2.de')).to be(nil)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa context 'on POST to DELETE' do
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { delete :destroy, id: adjoint.id, translation_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it 'not remove the record' do
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(LogicAdjoint.find_by_id(adjoint.id)).to eq(adjoint)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa end
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksaend