github.com/zaquestion/lab@v0.25.1/cmd/mr_create_test.go (about)

     1  package cmd
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/require"
     7  )
     8  
     9  // MR Create is tested in cmd/mr_test.go
    10  
    11  func Test_mrText(t *testing.T) {
    12  	text, err := mrText("origin", "mrtest", "origin", "master", false, false)
    13  	if err != nil {
    14  		t.Log(text)
    15  		t.Fatal(err)
    16  	}
    17  	require.Contains(t, text, `
    18  
    19  I am the default merge request template for lab
    20  # Requesting a merge into origin:master from origin:mrtest (1 commits)
    21  #
    22  # Write a message for this merge request. The first block
    23  # of text is the title and the rest is the description.
    24  #
    25  # Changes:
    26  #
    27  # 54fd49a`)
    28  
    29  }
    30  
    31  func Test_mrText_CoverLetter(t *testing.T) {
    32  	coverLetter, err := mrText("origin", "mrtest", "origin", "master", true, false)
    33  	if err != nil {
    34  		t.Log(coverLetter)
    35  		t.Fatal(err)
    36  	}
    37  	require.Contains(t, coverLetter, `
    38  
    39  I am the default merge request template for lab
    40  # Requesting a merge into origin:master from origin:mrtest (1 commits)
    41  #
    42  # Write a message for this merge request. The first block
    43  # of text is the title and the rest is the description.
    44  #
    45  # Changes:
    46  #
    47  
    48  54fd49a`)
    49  
    50  }