logic_adjoint_controller_spec.rb revision db149239590d2a39d399f12cd01609b190ea4763
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksarequire 'spec_helper'
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa create(:logic_mapping, source: source, target: target)
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:target_logic) { create :logic, user: user }
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:source_logic) { create :logic, user: user }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa source: source_logic, target: target_logic, user: user
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:target_logic2) { create :logic, user: user }
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:source_logic2) { create :logic, user: user }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa source: source_logic2, target: target_logic2, user: user
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa translation: mapping, projection: mapping2, user: user
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :show, id: adjoint.id, mapping_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa post :create, logic_mapping_id: mapping.id, logic_adjoint: {
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:adjoint_from_db) { LogicAdjoint.find_by_iri('http://test.de') }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.translation).to eq(mapping)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.projection).to eq(mapping2)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:adjoint_from_db) { LogicAdjoint.find_by_iri('http://test2.de') }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.translation).to eq(mapping)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.projection).to eq(mapping2)
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { delete :destroy, id: adjoint.id, mapping_id: mapping.id }
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicAdjoint.find_by_id(adjoint.id)).to be(nil)
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :edit, id: adjoint.id, mapping_id: mapping.id }
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :show, id: adjoint.id, mapping_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa post :create, logic_mapping_id: mapping.id, logic_adjoint: {
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa let!(:adjoint_from_db) { LogicAdjoint.find_by_iri('http://test.de') }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.translation).to eq(mapping)
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(adjoint_from_db.projection).to eq(mapping2)
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicAdjoint.find_by_iri('http://test2.de')).to be(nil)
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { delete :destroy, id: adjoint.id, translation_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa expect(LogicAdjoint.find_by_id(adjoint.id)).to eq(adjoint)
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :edit, id: adjoint.id, translation_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa it { should set_the_flash.to(/not authorized/i) }
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { get :show, id: adjoint.id, translation_id: mapping.id }
6f834e8d872b867ccae54a7a848e1db3f7857286Eugen Kuksa post :create, logic_mapping_id: mapping.id, logic_adjoint: {
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicAdjoint.find_by_iri("http://test.de")).to be(nil)
db149239590d2a39d399f12cd01609b190ea4763Eugen Kuksa expect(LogicAdjoint.find_by_iri('http://test2.de')).to be(nil)
23305f217b86a2ebf90a848af9036908e0070542Eugen Kuksa before { delete :destroy, id: adjoint.id, translation_id: mapping.id }